【问题标题】:Where does python's image_scraper library save images?python图像刮刀库在哪里保存图像?
【发布时间】:2017-07-26 11:44:58
【问题描述】:
我想将使用 python 的 image_scraper 库抓取的图像保存到我当前的工作目录。我该怎么做?我试过了,但它正在将 (0,0) 打印到屏幕上。那是什么。
我的代码是。
import image_scraper
image_scraper.scrape_images("http://womaura.com/wp-content/uploads/2016/12/o-HAPPINESS-facebook-1.jpg")
【问题讨论】:
标签:
python
python-2.7
web-scraping
【解决方案1】:
有一个参数叫download_path。如果你不使用像 PyCharm 这样的 IDE 来使用内置的 help 函数来查看每个函数的文档是个好主意
>>> import image_scraper
>>> help(image_scraper.scrape_images)
Help on function scrape_images in module image_scraper.mains:
scrape_images(url, no_to_download=None, format_list=['jpg', 'png', 'gif', 'svg', 'jpeg'], download_path='images', max_filesize=100000000, dump_urls=False, use_ghost=False)