link_node=soup.find('a', href=re.compile(r"ill"))
NameError: name 're' is not defined
NameError: name 're' is not defined
2018-04-12
現在百度的是https加密方式的了,而且目錄結構也變了,所以寫的時候要改一下
比如使用Request對象
response = urllib2.urlopen(request,context = context)
頁面解析的話可以
links = soup.findAll('a',href=re.compile(r"/item/"))
這樣子就能匹配到了
比如使用Request對象
response = urllib2.urlopen(request,context = context)
頁面解析的話可以
links = soup.findAll('a',href=re.compile(r"/item/"))
這樣子就能匹配到了
2018-04-12
最新回答 / 慕仙4312574
沒有其他部分的代碼,所以只能大致推測一下。正如錯誤信息所言'tuple indices must be integers not str'在視頻程序中data應該是dict類型,所以可以用data['url']來取出數據但是在你的程序中,data變成了tuple類型,而tuple只能用數字作為下邊取出數據所以才會報錯建議你檢查一下HtmlParser._get_new_data方法看看有沒有寫錯(以上全是猜的=。=)
2018-04-12
ModuleNotFoundError: No module named 'urlparse'
沒有這個模塊怎門辦
沒有這個模塊怎門辦
2018-04-09