0

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?
10
  • Do you get any mistakes? Commented Feb 9, 2020 at 22:20
  • @LucasDamian yes it shows path error basically i don't know how to assign path in this code and in this line chrome_driver = os.path.abspath(os.path.dirname(file)) + '/chromedriver' Commented Feb 10, 2020 at 5:56
  • if your project low-level complex then uses Lxml is a high-performance, production-quality HTML and XML parsing library. When you are dealing with Core Javascript featured website then Selenium would be the best choice. if you just want to scrape data of company and location then Beautiful Soup would be the great choice for you. Commented Feb 10, 2020 at 9:09
  • @ManaliKagathara this URL is not static its dynamic however i have tried HTML XML in excel still not able to get data plus i am newbie so that would be great if you can tell me how to use this things with example or in a more elaborate mennor. thank you Commented Feb 10, 2020 at 9:35
  • do you want to save data to file? Commented Feb 10, 2020 at 10:12

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.