elvisyjlin / media-scraper

Scrapes all photos and videos in a web page / Instagram / Twitter / Tumblr / Reddit / pixiv / TikTok
MIT License
371 stars 49 forks source link

AttributeError: 'MediaScraper' object has no attribute 'connect' #13

Closed ghost closed 5 years ago

ghost commented 5 years ago

Received the following error: "AttributeError: 'MediaScraper' object has no attribute 'connect'", after running the following code listed on the READEME.

import mediascraper
scraper = mediascrapers.MediaScraper()
scraper.connect(URL)
scraper.scrape(path=SAVE_PATH)

I noticed that the scrape method actually should include the URL argument and the connect method was for the Scraper class but not the MediaScraper class. I'm unsure how to fix myself but I hope I could help.

elvisyjlin commented 5 years ago

Hi Parker,

I'm sorry that the instruction for the general media scraper was out of date, which misled you. If you'd like to crawl images and videos in a web page. Let's say MY_URL. Please try python3 -m mediascraper.general "MY_URL" in your terminal. If you wanna import it in your Python code, please refer to the example.

The readme has been revised. Thanks for your questioning! Let me know if you have other problems.

Best.