I'm trying to locate an element on a page. If I do Inspect Element, I can see the HTML code and the XPATH, but when I view page source, there is only Javascript code. Any idea on how to see the HTML page instead?
This is the page: https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-50E42369DP1388723#/checkout/login
Here is the code. Basically I need to find the element and fill out the email and password field
while True:
try:
element = WebDriverWait(browser, 10).until(EC.presence_of_element_located((By.XPATH, '//*[@id="email"]')))
login_id = browser.find_element_by_xpath('//*[@id="email"]')
browser.execute_script("arguments[0].setAttribute('value', 'email address')", login_id)
login_password = browser.find_element_by_xpath('//*[@id="password"]')
browser.execute_script("arguments[0].setAttribute('value', 'enter password)", login_password)
account = browser.find_element_by_id('btnLogin')
browser.execute_script("arguments[0].click();", account)
break
except Exception as e:
print('Error: Couldnt login')