Python selenium, google plus automation.

TrillDappy

Registered Member
Joined
Jan 19, 2018
Messages
66
Reaction score
11
Hello BHW,

I am a total noop in this form, not sure if this is the write place for such a post.

Anyways, I have been learning python for the last 3 months and I have written some scripts to automate social media posting and scraping. Most of my scripts use selenium chrome driver for browser automations. At the moment I am trying to write a script that post into google plus forms, but I have been struggling with it. The problem is google plus uses a lot of JS to hide their buttons and prevent auto-clicks.

One of the problems that I could not solve for the past few days is clicking the “Post” button. I have tried to locate it via xpath and css, but none of them worked. I get the following error:
IndexError: list index out of range


The code that I have used is:
Code:
browser.find_elements_by_xpath(' //div[id=""][@class = "O0WRkf zZhnYe e3Duub C0oVfc"][@role = \'button\']').click()

Any help would be appreciated.
 
Your post button probably is inside an iframe .

So you first need to switch to that iframe and then locate the element using find_element_by_whatever_seems_fit methods .
 
Back
Top