Reputation: 1
Wrote a script in python selenium that enters the page, enters the number and presses the button, then goes to the new URL. How can I extract the URL I'm on from the browser's address bar?
import pandas as pd
from bs4 import BeautifulSoup
import requests
from urllib.parse import urlparse, urljoin
from selenium import webdriver
r = requests.get('https://kadbase.ru')
browser = webdriver.Chrome()
browser.get('https://kadbase.ru')
text_area_xpath = '/html/body/div/div[4]/div[1]/div[1]/div/div[2]/form/div[2]/input[1]'
browser.find_element_by_xpath(text_area_xpath).send_keys('45:25:020101:1481')
button_xpath = '/html/body/div/div[4]/div[1]/div[1]/div/div[2]/form/div[2]/input[2]'
browser.find_element_by_xpath(button_xpath).click()
Upvotes: 0
Views: 336