我正在尝试刮取this site,我想检查所有的锚定标记。你知道吗
我已经导入了beautifulsoup 4.3.2,下面是我的代码:
url = """http://www.civicinfo.bc.ca/bids?pn=1"""
Html = urlopen(url).read()
Soup = BeautifulSoup(Html, 'html.parser')
Content = Soup.find_all('a')
我的问题是内容总是空的(即Content=[])。有人有什么想法吗?你知道吗
Tags:
从the documentation开始
html.parser
在Python的某些版本之前不是很宽容。所以你可能看到了一些格式错误的HTML。你知道吗如果您使用
lxml
而不是html.parser
,那么您想要做的事情就会起作用从the documentation:
所以相关的代码是:
相关问题 更多 >
编程相关推荐