Hi, I want to manipulate the web boozer with selenium python. I brought this up in an other thread with a more vague topic (I dident know about selenium then). Where I was given the advice to use Selenium Python. And got some hope that I could get some assistance from the community here as well. I was overwhelmed by the helpfulness solving librecalc problem (I also learn a lot from this). And also libre calc is kind of involved later down the road in this as well.
What I want to do is a fairly simple (I believe) I want to copy one element from one page and then paste it in the search felled on an other page. And finally hit enter This will also involve separate tabs.
Just to try the principle perhaps we could with selenium open this page:
Then copy the first titel: “The Batman”
Next open a new tab (google.com) and the past "The Batman” in the search field and hit enter.
I cant use selenium or python but figured that it might be something like this:
driver.get(“Best 20 Movies of 2022 - IMDb”)
driver.maximize_window()
time.sleep(2)
#The CLASS element below corresponds to the title “The Batman”
driver.find_element(By.CLASS,‘lister-item-header’)
action = ActionChains(driver)
action.key_down(Keys.CONTROL).send_keys(‘c’).key_up(Keys.CONTROL).preform()
#Preferably get google in a new tab
driver.get(“https://www.google”)
#‘q’ is the google search field
driver.find_element(by=By.NAME,value=‘q’)
action = ActionChains(driver)
action.key_down(Keys.CONTROL).send_keys(‘v’).key_up(Keys.CONTROL).preform()
action.key(Keys.ENTER).send_keys.preform()
This code dosent work bur it would be interesting to know how to copy and past object between tabs like this! the text that after # is not part of the code off course