我想从网页中获取url目标的名称 这就是迄今为止我们所做的:
check ='https://www.zap.co.il/search.aspx?keyword='+'N3580-5092'
r = requests.get(check)
html = requests.get(r.url)
bsObj = BeautifulSoup(html.content,'xml')
storeName = bsObj.select_one('div.StoresLines div.BuyButtonsTxt')
结果是:
<div class="BuyButtonsTxt">
ב-<a aria-label="לקנייה ב-פיסי אונליין Dell Inspiron 15 3580
N3580-5092" href="/fs.aspx?pid=666473435&sog=c-pclaptop" id=""
target="_blank">פיסי אונליין</a>
</div>
我只需要href中的值:“פיסיאנ㪡ין” 怎么做
我不得不将
bsObj = BeautifulSoup(html.content,'xml')
更改为bsObj = BeautifulSoup(html.content,'html.parser')
,因为“xml”无法为我找到标记输出:
相关问题 更多 >
编程相关推荐