问题
I am scraping data from this URL. This is my code:
from selenium import webdriver
import os
import time
chrome_driver = os.path.abspath(os.path.dirname(__file__)) + '/chromedriver'
browser = webdriver.Chrome(chrome_driver)
browser.get("https://angel.co/companies?locations[]=1688-United+States")
time.sleep(3)
data_row = browser.find_elements_by_class_name('base.startup')
for item in data_row:
print('-'*100)
company = item.find_element_by_class_name('name').text
location = item.find_element_by_class_name('column.location').text
print(company)
print(location)
Can anyone please help me with? I am using Windows 10.
- What should be the path of my file which i am collecting all data in?
- Is this code right or is there another library available which scrapes data faster then BS or selenium?
来源:https://stackoverflow.com/questions/60139211/how-to-set-paths-while-scraping-data-from-website