This question already has answers here:
How to open a link embeded in a webelement with in the main tab, in a new tab of the same window using Control + Click of Selenium Webdriver
(3 answers)
Opening a new tab using Ctrl + click combination in Selenium Webdriver
(3 answers)
Closed 1 year ago.
I followed the guide from GeekForGeeks, how to use ActionChains in selenium. Somehow nether their nor any other keys will perform. I need to download a pdf file via ctrl + S and it is not possible to do it otherwise (I checked it with many other people too).
Related
This question already has answers here:
How to handle the popup "Accepting all cookies" when the element is data-testid - Using Selenium in Python
(2 answers)
How to extract info within a #shadow-root (open) using Selenium Python?
(1 answer)
Closed last year.
How can we apply wait on shadow dom web elements using selenium webdriver?
The normal wait using the following code doesn't seem to work on shadow elements.
WebDriverWait(driver,15).until(EC.visibility_of_all_elements_located((By.XPATH,"/html/body/widget-commponent//div/div[2]")))
Kindly help if anyone knows how to do that.
Thanks.
This question already has answers here:
Selenium webdriver: Modifying navigator.webdriver flag to prevent selenium detection
(15 answers)
Can a website detect when you are using Selenium with chromedriver?
(25 answers)
Is there a way to use Selenium WebDriver without informing the document that it is controlled by WebDriver?
(1 answer)
Closed 1 year ago.
I am trying to interact with a webpage that has strong bot detection measures. This means I cannot use things like Requests, Scrapy or Selenium as they get detected. Even Undetected Chromedriver doesn't work.
I just need to perform a few simple clicks on the site so am trying to implement something using Pyautogui.
However, I still need to find whether certain elements exist. Is there a way of doing this without using those libraries?
This question already has answers here:
Open web in new tab Selenium + Python
(21 answers)
Selenium Switch Tabs
(4 answers)
Closed 2 years ago.
sorry that my english grammar is soo bad and still newbie in stackoveflow comunity. Before ask, i already try to find my problem solution but i found dead end and now i try to ask question in stackoverflow
can someone told me how to open link in new tab without create blank new tab, or maybe you can give me suggestion how to make my code better
this is my code :
from selenium import webdriver
#use webdrive
drive=webdriver.Firefox()
#open google and find something
drive.get("https://www.google.com/")
search=drive.find_element_by_xpath('/html/body/div/div[2]/form/div[2]/div[1]/div[1]/div/div[2]/input')
search.send_keys('find something')
tombol=drive.find_element_by_xpath('/html/body/div/div[2]/form/div[2]/div[1]/div[3]/center/input[1]')
tombol.click()
#now you list every website top search google
links=drive.find_elements_by_class_name('r')
#iterate every website and open new tab
i=0
for link in links:
#code to execute link in new tab
#i just found how to click single website
link.click()
This question already has answers here:
How to open multiple webpages in separate tabs within a browser using selenium-webdriver and python
(1 answer)
Open web in new tab Selenium + Python
(21 answers)
Closed 3 years ago.
using a MAC OS im trying to open a new tab using selenium firefox webdriver
url = "https://google.com"
mail = wd.Firefox()
mail.get(url)
time.sleep(1)
actions = ActionChains(mail) mail.find_element_by_xpath("/html/body/div[2]/div[2]/div[1]/h2/span[2]/span[1]").click()
time.sleep(1)
ActionChains(mail).key_down(Keys.COMMAND).send_keys('t').key_up(Keys.COMMAND).perform()
mail.close()
mail.quit()
if you are using chrome/firefox you can run this javascript.
window.open("https://google.com","_blank")
Python:
driver.execute_script("window.open('https://google.com','_blank')")
This question already has an answer here:
Selenium Webdriver with Python - driver.title parameter
(1 answer)
Closed 4 years ago.
I am successfully opening a url using selenium and python. Above the address bar in the browser there is a tab that gets opened, I am trying to get the name that tab displays.
For e.g. I opened the url - https://8.8.8.8
After it is opened, tab name appears as Google.
I am trying to fetch the name of the tab i.e google.
Simply call driver.title. See below:
from selenium import webdriver
d = webdriver.Chrome()
d.get('https://python.org')
d.title
# 'Welcome to Python.org'