Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 从从javascript站点抓取的数据中提取href_Python_Web Scraping_Beautifulsoup_Python Requests Html - Fatal编程技术网

Python 从从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

我正在从一个使用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
product.attrs['href']
对不起,我读错了,一开始并没有发现是什么问题,谢谢你的帮助!