import urllib.request
import re
web=urllib.request.urlopen('https://www.gpyh.com/pricebuy/index?pageNum=1&hasStock=&goodsStandardId=1931&materialDictCode=&materialGroupCode=037001&diameter=&length=&brandId=&merchantId=')
neirong=web.read()
def getPage(self,pageIndex):
url = self.siteURL + "?pageNum=" + str(pageIndex)
request = urllib2.Request(url)
response = urllib2.urlopen(request)
return response.read().decode('gbk')
jiangrenhua=neirong.decode('UTF-8')
RegularExpression='<td>(.*)<\/td>'
Valuable=re.findall(RegularExpression,jiangrenhua)
information=[]
for i in range(173):
print(Valuable[i]
這一個不就是你的頁碼控制嗎?
登入後才看到那就用cookie或使用者名稱密碼模擬登入後取得
httplib2基本上應該是所有http請求的終結者了吧。