Python 从从javascript站点抓取的数据中提取href
我正在从一个使用javascript的网站上抓取一些数据,我特别尝试提取存储在href中的数据。有关守则:Python 从从javascript站点抓取的数据中提取href,python,web-scraping,beautifulsoup,python-requests-html,Python,Web Scraping,Beautifulsoup,Python Requests Html,我正在从一个使用javascript的网站上抓取一些数据,我特别尝试提取存储在href中的数据。有关守则: response.html.render() for product in response.html.find('a.product-name-link'): link.append(product) print(link) 这将打印以下内容: ,,] 如何使href信息只存储在产品中 谢谢大家! link.append(product['href'])@QHarr
response.html.render()
for product in response.html.find('a.product-name-link'):
link.append(product)
print(link)
这将打印以下内容:
,,]
如何使href信息只存储在产品中
谢谢大家!
link.append(product['href'])
@QHarrproduct.attrs['href']
对不起,我读错了,一开始并没有发现是什么问题,谢谢你的帮助!