最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - How to pull image link from shortcuts - Stack Overflow

programmeradmin3浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论