【发布时间】:2018-01-05 04:12:37
【问题描述】:
我正在尝试抓取标签的内容。这是一个html的例子:
<p><a href="https://requiredlink.com" download>Download<span class="caret">
这是我正在做的事情:
r = requests.get("https://abc.efg.questions").content
html_obj = html.fromstring(r)
soup = BeautifulSoup(r)
for a in soup.find_all("a", text=re.compile("Download")):
print a['href']
打印语句不返回任何内容。我的做法有问题吗?
【问题讨论】:
标签: html python-2.7 web-scraping beautifulsoup