How to scrape company names from inc5000?


I am trying to scrape all company names from inc5000 site (""). The problem is that the company names are displayed using JavaScript. I have tried using selenium and requests_html both to render the site but still when I fetch source code of page i get JavaScript. This is what I tried. I am new to web scraping so it is possible that I am making some foolish mistake. please guide

Here is my code.


from selenium import webdriver
from import ChromeDriverManager
from import Options
from bs4 import BeautifulSoup
options = Options()
options.headless = True

driver = webdriver.Chrome(ChromeDriverManager().install(),options=options)


Why do you need beautiful soup, you just could use selenium:

from selenium import webdriver
from import By

driver = webdriver.Chrome()

companies = [e.text for e in driver.find_elements(By.CLASS_NAME, "company")]

This will only give you the elements in the viewport. You need to improve on that by scrolling.

Answered By – dosas

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published