我正试图从eBay.com上获取物品的价格,但由于某些原因我无法获取
price_BeautifulSoup = bs.find("span", {"id": "prcIsum"}).text
# What the console prints: "<class 'bs4.BeautifulSoup'>"
我所尝试的:
"class 'bs4.BeautifulSoup'"
李>price_BeautifulSoup = bs.find('span', attrs={"id": "prcIsum"}).get_text().strip()
整个代码:https://pastebin.com/Vb5gd7RL
提前谢谢。说真的
您打印了错误的变量:
你想要:
如果想要一个单独的价格,可以提取content属性
如果要匹配selenium列表输出,请按空格拆分:
试试这个:
相关问题 更多 >
编程相关推荐