-3
我看到這個代碼Parse the html code for a whole webpage scrolled down但我不想只是文本,我也想要id。我怎麼做?如何獲得Selenium的推特ID
我看到這個代碼Parse the html code for a whole webpage scrolled down但我不想只是文本,我也想要id。我怎麼做?如何獲得Selenium的推特ID
如果你想從您提供的答案中使用的代碼,你可以得到的tweet ID是這樣的:
soup = BeautifulSoup(page_source, 'html.parser')
for tweet in soup.select("div.tweet"):
print tweet['data-tweet-id']
謝謝,這工作就好了。 (我必須嘗試/除外)。 –