0

when I try to enter the site (https://www.ticketcorner.ch/en/artist/iihf-eishockey-weltmeisterschaft/2020-iihf-ice-hockey-world-championship-einzelspiel-tickets-zuerich-2463148/?affiliate=IIH)using Selenium webdriver, I get captcha or blocking page. Are there any ways to get around this without using captcha recognition services? Thank you.

UPD. Attached captcha img enter image description here

import time


from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from multiprocessing import Pool, freeze_support
from bs4 import BeautifulSoup


def main():
    options = webdriver.ChromeOptions()
    options.add_argument('headless')
    driver = webdriver.Chrome(chrome_options=options)
    driver.get('https://www.ticketcorner.ch/en/artist/iihf-eishockey-weltmeisterschaft/2020-iihf-ice-hockey-world-championship-einzelspiel-tickets-zuerich-2463148/?affiliate=IIH')
    while True:
        time.sleep(3)
        driver.refresh()
        try:
            WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.XPATH, '//h2[@class="event-listing-city theme-headline-color"]')))
            source = driver.page_source

            soup = BeautifulSoup(source, 'lxml')
            elements = soup.find_all('h2', class_='event-listing-city theme-headline-color')
            matches = []
            for elem in elements:
                matches.append(elem.text)
            print(matches)
        except Exception as e:
            print('Parsing error', str(e))

if __name__ == "__main__":
    main()
FleXX
  • 129
  • 1
  • 7
  • What type of captcha is it? If it is a simple click one they there are ways around it. But if it is a "Click the images" then it becomes a lot more complex. But there isn't a way to avoid it completly. Captcha were created to stop scrapers like this one. – Edeki Okoh Feb 05 '20 at 17:55
  • Yes, this is a captcha with images. Maybe there are some ways to emulate human behavior, js requests, and other? – FleXX Feb 05 '20 at 18:05

0 Answers0