Ejemplo n.º 1
0
    "https://www.indeed.com/Best-Places-to-Work",
    "https://www.indeed.com/Best-Places-to-Work?y=2017&cc=US&start=25"
]

#get values of Select(driver.find_element_by_xpath("//div[@id = 'cmp-discovery-country-select']/select"))

companies = []

for item in links:
    navigate_page(driver, item)

    # select the country. Include this in another for-loop? for item in country
    select = Select(
        driver.find_element_by_xpath(
            "//div[@id = 'cmp-discovery-country-select']/select"))
    select.by_value = ('United States')

    company_name = driver.find_elements_by_xpath(
        "//div[@id = 'cmp-curated']/div/a/h4[@itemprop='name']")
    for i in range(0, len(company_name)):
        companies.append(company_name[i].text)

    # select the reviews.

for item in companies:
    rev_comp = []
    pros_comp = []
    cons_comp = []
    #name_slice = item. not sure if this is the easiest way. url is www.indeeed.com/name-of-company. slash btw words need to be added

    #input company name in search field