简体   繁体   English

python 列出所有带有特殊图片的网页

[英]python list all webpages with a special image

I want to create a list of all pages with this image (image.png).我想创建一个包含此图像 (image.png) 的所有页面的列表。 I did the following, what do I need to change?我做了以下,我需要改变什么?

import requests
from bs4 import BeautifulSoup

def getdata(url):
r=request.get(url)
return r.text

data = getdata ("https://url")
soup = BeautifulSoup(data)

image_links = soup.find_all('img', {'src': 'image.png'})
print (imgae_links)

I think you want to scrape a javascript website you can use selenium or any library see this我想你想抓取一个 javascript 网站,你可以使用 selenium 或任何图书馆看到这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM