admin管理员组文章数量:1387418
im currently building a scraper for a google sheet. I can scrape all text based things easily but ive run into a problem with links hidden in shortcuts. I have no clue how to extract them. I previously used the follwing to extract the image links:
url = '#gid=0'
answer = requests.get(url)
table = BeautifulSoup(answer.text, "html.parser")
print(table.select('td img[src]'))
# convert all img links to text
for img in table.select('td img[src]'):
img.replace_with(img['src'])
pd.set_option('display.max_columns', None) # Display all columns
pd.set_option('display.max_rows', None) # Display all rows (you can adjust as needed)
pd.set_option('display.width', 1000) # Set a wide display width
df = pd.read_html(StringIO(str(table)))[0]
But this doest work with the follwing Spreadsheet. I think the images arent rendered by just a request but i dont have a clue how to solve it.
本文标签: pythonHow to pull image link from shortcutsStack Overflow
版权声明:本文标题:python - How to pull image link from shortcuts - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744541371a2611632.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论