-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathmain.py
19 lines (15 loc) · 836 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from helpers.scraper import Scraper
from helpers.csv_helper import get_data_from_csv
from helpers.listing_helper import update_listings
scraper = Scraper('https://facebook.com')
# Add login functionality to the scraper
scraper.add_login_functionality('https://facebook.com', 'svg[aria-label="Your profile"]', 'facebook')
scraper.go_to_page('https://facebook.com/marketplace/you/selling')
# Get data for item type listings from csvs/items.csv
item_listings = get_data_from_csv('items')
# Publish all of the items into the facebook marketplace
update_listings(item_listings, 'item', scraper)
# Get data for vehicle type listings from csvs/vehicles.csv
vehicle_listings = get_data_from_csv('vehicles')
# Publish all of the vehicles into the facebook marketplace
update_listings(vehicle_listings, 'vehicle', scraper)