好吧,伙计们,我正在刮:https://twitter.com/iForex_com/status/1019547735614255104
如果有人能帮助我,我将不胜感激
import requests
from lxml import html
finalurl = f"https://www.twitter.com/user/status/{id}"
response = requests.get(finalurl,allow_redirects=True)
tree = html.fromstring(response.content)
print("getting photolink")
postPhotoLink = tree.xpath('//*[@id="react-root"]/div/div/div/main/div/div/div/div[1]/div/div[2]/div/section/div/div/div/div[1]/div/article/div/div[4]/div/div/div/a/div/div[2]/div/img/@src')
print(postPhotoLink)
结果:
获取照片链接 []
手掌心
慕运维8079593
相关分类