Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #need some of the libraries for later code
- from bs4 import BeautifulSoup as soup
- import requests
- import sys
- import re
- from selenium import webdriver
- from selenium.webdriver.common.keys import Keys
- from selenium.webdriver.chrome.options import Options
- from selenium.webdriver.common.by import By
- from selenium.webdriver.support.ui import WebDriverWait
- from selenium.webdriver.support import expected_conditions as EC
- input("If ready press 'enter'")
- loginurl = 'https://www.willhaben.at/iad/?islogout=true&logoff.y=10'
- chrome_options = Options()
- chrome_options.add_argument('disable-infobars')
- driver = webdriver.Chrome(executable_path="C:\Users\laure\Downloads\chromedriver_win32\chromedriver.exe", chrome_options=chrome_options, service_args=['--ignore-ssl-errors=true', '--ssl-protocol=any'])
- USERNAME = 'notgonnagiveit :)'
- PASSWORD = 'notgonnagiveit'
- driver.get(loginurl)
- element = WebDriverWait(driver, 10).until(
- EC.presence_of_element_located((By.XPATH, '//*[@id="username"]'))
- )
- username = driver.find_element_by_xpath('//input[@id="username"]')
- password = driver.find_element_by_xpath('//input[@id="password"]')
- password.send_keys(PASSWORD)
- username.send_keys(USERNAME)
- driver.get("https://www.willhaben.at/iad/myprofile/adadministration/showlist?page=6")
- editbutton = driver.find_element_by_xpath("//input[@class='btn icon-icon_bearbeiten status-expired'][@type='button']")
- editbutton.click()
- driver.quit()
- Traceback (most recent call last):
- File "D:OneDriveDokumenteWillhabenWillhaben.py", line 84, in <module>
- editbutton = driver.find_element_by_xpath("//input[@class='btn icon-icon_bearbeiten status-expired'][@type='button']")
- File "C:UserslaureAppDataLocalProgramsPythonPython35libsite-packagesseleniumwebdriverremotewebdriver.py", line 368, in find_element_by_xpath
- return self.find_element(by=By.XPATH, value=xpath)
- File "C:UserslaureAppDataLocalProgramsPythonPython35libsite-packagesseleniumwebdriverremotewebdriver.py", line 858, in find_element
- 'value': value})['value']
- File "C:UserslaureAppDataLocalProgramsPythonPython35libsite-packagesseleniumwebdriverremotewebdriver.py", line 311, in execute
- self.error_handler.check_response(response)
- File "C:UserslaureAppDataLocalProgramsPythonPython35libsite-packagesseleniumwebdriverremoteerrorhandler.py", line 237, in check_response
- raise exception_class(message, screen, stacktrace)
- selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@class='btn icon-icon_bearbeiten status-expired'][@type='button']"}
- (Session info: chrome=63.0.3239.84)
- (Driver info: chromedriver=2.34.522940 (1a76f96f66e3ca7b8e57d503b4dd3bccfba87af1),platform=Windows NT 10.0.16299 x86_64)
Add Comment
Please, Sign In to add comment