Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.0 kB
2
Indexable
Never
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

# Set up the Selenium webdriver
driver = webdriver.Chrome()

# Navigate to the page
driver.get("https://nab23.mapyourshow.com/8_0/#/searchtype/category/search/18/show/all")

# Wait for the page to load
wait = WebDriverWait(driver, 10)
wait.until(EC.presence_of_element_located((By.CLASS_NAME, "exhibitor-name")))

# Find all the links to the company pages
company_links = driver.find_elements_by_xpath("//a[contains(@href, '/8_0/exhibitor/exhibitor-details')]")

# Loop through the links and download the company names
for link in company_links:
    company_url = link.get_attribute("href")
    driver.get(company_url)
    wait.until(EC.presence_of_element_located((By.CLASS_NAME, "exhibitor-title")))
    company_name = driver.find_element_by_class_name("exhibitor-title").text
    print(company_name)

# Close the webdriver
driver.quit()