Categories
Mastering Development

Taking a certain part of the page with selenium

from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.webdriver import ActionChains import selenium.webdriver.common.keys from bs4 import BeautifulSoup import requests import time driver = webdriver.Chrome(executable_path=”../drivers/chromedriver.exe”) driver.get(“https://www.Here the address of the relevant website ends with aspx.com.aspx”) element=driver.find_element_by_id(“ctl00_ContentPlaceHolder1_LB_SEKTOR”) drp=Select(element) drp.select_by_index(0) element1=driver.find_element_by_id(“ctl00_ContentPlaceHolder1_Lb_Oran”) drp=Select(element1) drp.select_by_index(41) element2=driver.find_element_by_id(“ctl00_ContentPlaceHolder1_LB_DONEM”) drp=Select(element2) drp.select_by_index(1) driver.find_element_by_id(“ctl00_ContentPlaceHolder1_ImageButton1”).click() time.sleep(1) print(driver.page_source) The last part of these codes, I can […]