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请求的终结者了吧。