I remowed your code as it containt login info.
Here is code without login info.
So what dos line 54 print,is it a
Here is code without login info.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
from xml.etree.ElementTree import fromstring import requests from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver import Keys from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager from generic.Login import Login from lxml import html, etree from xml.etree import ElementTree as ET options = Options() options.add_experimental_option( "detach" , True ) driver = webdriver.Chrome(service = Service(ChromeDriverManager().install()), options = options) class AIS_Import(Login): Login.login_func(driver, "https://www.thyme-it.net/aep2/sadlist/sadlist.html" , "thymeit" , "xxxx" , "xxxx" ) '''Navigate to AIS Import template''' driver.find_element( "xpath" , "/html/body/div/div[3]/ul/li[1]/a" ).click() driver.find_element( "xpath" , "/html/body/div/div[3]/ul/li[1]/ul/li[2]/a" ).click() driver.find_element( "xpath" , "//a[text()= 'AIS Import']" ).click() '''Click on the first template(should be AUTO:..''' links = driver.find_elements( "xpath" , "//table//a" ) links[ 0 ].click() '''Select all checkboxes from dropdown''' ais_checkbox = driver.find_elements( "xpath" , "//input[@type='checkbox']" ) count_checkbox = 0 for val in ais_checkbox: count_checkbox + = 1 try : val.click() except Exception as e: print (e) print (count_checkbox) '''Finish and send the declaration to Revenue''' driver.find_element( "id" , "finished" ).click() '''XML File comparison''' '''Get the XML''' driver.find_element( "xpath" , "//input[@value='Get XML']" ).click() response = requests.get(driver.current_url) print (response) soup = BeautifulSoup(response.content, 'lxml-xml' ) print (soup) |
url
(to the raw .xml) eg same as open link under in browser that has .xml
ending. 1 |
https: / / www.w3schools.com / xml / plant_catalog.xml |