从亚马逊(Amazon)或Flipkart(Flipkart)刮取产品图像的小菜一碟的方法
imgscrape的Python项目详细描述
imgscrage是一个基于selenium和pillow的图像刮刀。
功能!
- 刮除图像链接
- 将图像转换为缩略图
- 将图像编码为base64
- 将图像直接保存到开发中的文件夹:
imgscrage是一个基于selenium和pillow的图像刮刀。您只需提供产品链接或其列表,它就会根据您的论点提供图片或列表中的链接。
The reason behind this idea is to scrape image links are unreachable by using Beautifulsoup4. Thus switching to selenium gets you the images you need.
安装和使用
$ pip install imgscrape
- imgscrace需要chromedriver才能运行。下载它。
- 下载之后,您需要向构造函数提供chromedriver的路径。
from imgscrape import imgscrape any_var = #path to driver var = imgscrape(producturl, path= any_var)
- 您可以提供产品url列表并获取列表中的图像链接。
from imgscrape import imgscrape any_var = #path to driver lst_var = ['link1', 'link2', 'link3'] var = imgscrape(*lst_var, path= any_var)
开发
想做贡献吗?伟大的! 创建一个请求,我们会看到的。
支持
- linux
- windows
- ###待办事项
- 添加对MacOS的支持
- 添加更多支持的网站
许可证
- 麻省理工学院
免费软件,见鬼!