【发布时间】:2017-01-14 07:55:23
【问题描述】:
我看到了这段代码Parse the html code for a whole webpage scrolled down,但我不想要文本,我也想要 id。我该怎么做?
【问题讨论】:
标签: python selenium twitter beautifulsoup
我看到了这段代码Parse the html code for a whole webpage scrolled down,但我不想要文本,我也想要 id。我该怎么做?
【问题讨论】:
标签: python selenium twitter beautifulsoup
如果您想使用您提供的答案中的代码,您可以像这样获取推文 ID:
soup = BeautifulSoup(page_source, 'html.parser')
for tweet in soup.select("div.tweet"):
print tweet['data-tweet-id']
【讨论】: