刷某网站新贴,呵呵哒
刷某网站新贴,呵呵哒
import os,sys,types
import time,requests,json
from selenium import webdriver
from bs4 import BeautifulSoup
def gettime():return time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))HOSTURLS = []
def HostLoc():try:url = "https://*.com/forum-45-1.html"heads = {"user-agent":"firefox"}r = requests.get(url, headers = heads,timeout=5)#print(r.text)soup = BeautifulSoup(r.text, 'html.parser')links = soup.find_all("a", class_="s xst")for item in links:s = item.get("href")if (s in HOSTURLS):continueelse:HOSTURLS.append(s)s = "https://*.com/" + st = item.next_element[:250]print(gettime(),s,t)except:passif __name__ == '__main__':while True:print("*" * 60)time.sleep(5)HostLoc()
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
