#注意爬取太频繁IP会被封锁好几天
#因为有的页面因为游戏停止买卖 所以range会跳空很多号码
import requests,time
from bs4 import BeautifulSoup
file = open("8591.txt",'a+')
header ={
'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Accept-Encoding':'gzip,deflate',
'Accept-Language':'zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-CN;q=0.6',
'Cache-Control':'max-age=0',
'Connection':'keep-alive',
'Cookie':'自訂',
'Host':'www.8591.com.tw',
'Upgrade-Insecure-Requests':'1',
'User-Agent':'Mozilla/5.0(WindowsNT6.1;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/72.0.3626.121Safari/537.36'
}
for i in range(29630,100000):
print(str(i) + '\n')
url = "http://www.8591.com.tw/mallList-list.html?searchGame=" + str(i) + "&searchServer=&buyStatus=1&searchType=&searchKey=&uid="
res = requests.get(url=url,headers=header)
soup = BeautifulSoup(res.text,'lxml')
#没有找到"class":"search_none_info" 代表有成交纪录 也就是会等於None
if ( soup.find("div",attrs={"class":"search_none_info"}) == None ):
print(str(i) + " 有成交纪录")
print(url)
file.write(str(i) + '\n')
file.flush()
8591游戏网查询成交纪錄
最新推荐文章于 2025-08-03 19:19:28 发布