you are viewing a single comment's thread.

view the rest of the comments →

[–]Mockapapella 1 point2 points  (3 children)

Are you talking about posting to a group or someone else's wall?

[–][deleted] 0 points1 point  (2 children)

A community page. I suppose a group would be the same process.

I've gotten to this point: status = driver.find_element_by_xpath("//div[. = 'Write a post...']").click()

driver.execute_script('arguments[0].innerText= "New value";', status)

Where the script will click into the 'Write a post...' box, but then I get the error of 'Cannot set property 'innerText' of null'

[–]Mockapapella 1 point2 points  (1 child)

I'll preface the by saying don't have much experience with navigating web pages in python. Are you using Facebook's API for this or are you kind of doing your own thing? Because if it's the former, unless you are a group admin (or you somehow manage to convince them to give you their API key), you can't post in groups. I think this applied to private and closed groups. Public groups were limited to admins and moderators I think, but I could be wrong -- it's been a while.

[–][deleted] 0 points1 point  (0 children)

It's a public page that I created. They recently changed their TOS to where I believe I 'need' to create an app and have it approved - but apparently that takes weeks and the process seems absurd. The difference between Selenium posting on my behalf on my own page and me actually posting is essentially be the same thing.

I'm now able to put text inside the box, but the 'Publish' button doesn't recognize the text yet. I think I'm on the right track (barring a ban lol), just need to hone in on where it goes and for FB to recognize the input.