How To Automate Facebook Post | Automation Using Python And Selenium | [2020]
This video is about Writing Post On Facebook with help of selenuim in Python.
Download Drivers: sites.google.com/a/chromium.o...
#selenium #automation #python
Code Sample:
from selenium import webdriver
from time import sleep
import time
driver=webdriver.Chrome('/Users/satyendra/downloads/chromedriver')
driver.get('www.facebook.com')
//*[@id="email"]
//*[@id="pass"]
//*[@id="loginbutton"]
email=driver.find_element_by_xpath('.//*[@id="email"]')
email.send_keys('7278222619')
password=driver.find_element_by_xpath('.//*[@id="pass"]')
#password.send_keys()
with open('pass.txt','r') as myfile:
password1=myfile.read().replace('
','')
password.send_keys(password1)
login=driver.find_element_by_xpath('.//*[@id="loginbutton"]')
login.click()
sleep(3)
postarea=driver.find_element_by_class_name('_5qtp')
postarea.click()
sleep(3)
activepostarea=driver.switch_to_active_element()
activepostarea.send_keys("Hello Programmer")
postbtn=driver.find_elements_by_tag_name('button')
for btn in postbtn:
print(btn.text)
if btn.text=='Post':
btn.click()
#_1mf7 _4r1q _4jy0 _4jy3 _4jy1 _51sy selected _42ft
button=driver.find_element_by_css_selector('._1mf7._4r1q._4jy0._4jy3._4jy1._51sy.selected._42ft')
button.click()
Follow us on:
Whatsapp:
chat.whatsapp.com/LNwHGukUizj...
Facebook:
/ coderscart
Linkedin:
/ satyendra-jaiswal-9035...
Instagram:
/ codingcart
Пікірлер: 45
This is such a great and working tutorial on this subject. Would you happen to have the same one only that makes posts to Instagram accounts?
Great!!!!!! You are really good. Thanks for sharing this knowledgment from yours. Sue.
Wow, what nice explanation.👌👌👌
@codingcart
4 жыл бұрын
Glad you liked it
Keep going...
@codingcart
4 жыл бұрын
Thank you, I will
Super keep going
@codingcart
4 жыл бұрын
Thank you, I will
Awesome one
@codingcart
4 жыл бұрын
Thanks ✌️
Woderful Explanation
@codingcart
4 жыл бұрын
Glad you liked it
Simply awesome
@codingcart
3 жыл бұрын
Thanks a lot 😊
Such a good video
@codingcart
4 жыл бұрын
Thanks
Nice explanation
@codingcart
4 жыл бұрын
Thanks for liking
Superb
@codingcart
4 жыл бұрын
Thanks 🤗
Did you ever update the code to have it automatically click 'block' on the chrome browser notification instead of you manually clicking it?
@mythm2063
11 ай бұрын
Did you find a solution for that??
Thank you "driver.switch_to.active_element" is a nice comment
how can we make for the webdriver to click the block for notifications? and ive noticed that annoying black screen right on the facebook feed, how can we get rid of that screen too?
@ananthsai1236
3 жыл бұрын
Hi , I am stuck at the same point.. You got anything.?
Hello! can you create a video on how to create a bot on facebook user account not on page using python or js ?
Your code works for Facebook 'Classic' style interface, but does not work for the NEW Facebook interface. Can you PLEASE create a new video on posting for the NEW interface? The problem starts with postarea=driver.find_element_by_class_name('_5qtp') as this class is not in the new interface HTML. I tried to locate it, but NO luck... Thanks Much For Your Great Tutorials!
@mythm2063
11 ай бұрын
Hello any solution for that please?
how to post a picture with selenium, not only text?
Please update the video there is no button tag name while inspecting .. the class name for create post is very very big switch to active element is no more in use 😒😒😒
Do you know how to do the same with the library Requests? Sending a request to graph facebook api on Python 3.8? Send me news, if u know. Tks. Congradulations by your channel!!!
@harshmirdhwal
2 жыл бұрын
Your page Id in place of page id
Hello, Would it still working in 2021
@codingcart
2 жыл бұрын
Haven't tried, just give a try from your end😊
sorry sir but how to make automatic post for facebook page and schendule?
@codingcart
3 жыл бұрын
It was automatic..Are you asking anything different??
So quick....
@codingcart
4 жыл бұрын
:)
is there any updated code?
@codingcart
3 ай бұрын
No buddy, they updated their page layout
will facebook ban me for this?
@codingcart
3 жыл бұрын
No
#Jarveepro will help you schedule your posts to be automatically published at the most active time for most followers
complete waste of time and irrelevant code
@codingcart
10 ай бұрын
It will not work for new Facebook interface