diff --git a/pinterest_crawler/src/config.py b/pinterest_crawler/config.py similarity index 100% rename from pinterest_crawler/src/config.py rename to pinterest_crawler/config.py diff --git a/pinterest_crawler/pinterest_crawler.py b/pinterest_crawler/pinterest_crawler.py index 5be6e35..a6163a6 100644 --- a/pinterest_crawler/pinterest_crawler.py +++ b/pinterest_crawler/pinterest_crawler.py @@ -2,7 +2,8 @@ import random import argparse from itertools import combinations -from src import PinterestScraper, PinterestConfig +from .scraper import Scraper +from .config import Config def main(): @@ -34,7 +35,7 @@ def main(): print(keyword) while True: - configs = PinterestConfig(search_keywords=keyword, # Search word + configs = Config(search_keywords=keyword, # Search word # total number of images to download (default = "100") file_lengths=5000, # image quality (default = "orig") @@ -44,7 +45,7 @@ def main(): scroll=10000) # download images directly - number = PinterestScraper(configs).download_images(args.output) + number = Scraper(configs).download_images(args.output) print("number:", number) if number == 0: counter += 1 diff --git a/pinterest_crawler/src/scraper.py b/pinterest_crawler/scraper.py similarity index 100% rename from pinterest_crawler/src/scraper.py rename to pinterest_crawler/scraper.py diff --git a/pinterest_crawler/src/__init__.py b/pinterest_crawler/src/__init__.py deleted file mode 100644 index d757b08..0000000 --- a/pinterest_crawler/src/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from src.config import Config as PinterestConfig -from src.scraper import Scraper as PinterestScraper \ No newline at end of file diff --git a/tests/test_main.py b/tests/test_pinterest_crawler.py similarity index 94% rename from tests/test_main.py rename to tests/test_pinterest_crawler.py index 4c3579b..a3bf155 100644 --- a/tests/test_main.py +++ b/tests/test_pinterest_crawler.py @@ -17,4 +17,4 @@ def test_download(self): if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main()