How to set paths while scraping data from website

女生的网名这么多〃 提交于 2020-03-26 03:53:26

问题


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.

  1. What should be the path of my file which i am collecting all data in?
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!