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

  • @glenfreiboth3587
    @glenfreiboth35873 жыл бұрын

    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?

  • @suedavid83
    @suedavid833 ай бұрын

    Great!!!!!! You are really good. Thanks for sharing this knowledgment from yours. Sue.

  • @amanrajan2732
    @amanrajan27324 жыл бұрын

    Wow, what nice explanation.👌👌👌

  • @codingcart

    @codingcart

    4 жыл бұрын

    Glad you liked it

  • @riyagupta9869
    @riyagupta98694 жыл бұрын

    Keep going...

  • @codingcart

    @codingcart

    4 жыл бұрын

    Thank you, I will

  • @dhilipmaharish
    @dhilipmaharish4 жыл бұрын

    Super keep going

  • @codingcart

    @codingcart

    4 жыл бұрын

    Thank you, I will

  • @AmanKumar-rr1qx
    @AmanKumar-rr1qx4 жыл бұрын

    Awesome one

  • @codingcart

    @codingcart

    4 жыл бұрын

    Thanks ✌️

  • @sachinsingh-jg9lx
    @sachinsingh-jg9lx4 жыл бұрын

    Woderful Explanation

  • @codingcart

    @codingcart

    4 жыл бұрын

    Glad you liked it

  • @_mandeep_kumar.
    @_mandeep_kumar.3 жыл бұрын

    Simply awesome

  • @codingcart

    @codingcart

    3 жыл бұрын

    Thanks a lot 😊

  • @AmanKumar-mg3qv
    @AmanKumar-mg3qv4 жыл бұрын

    Such a good video

  • @codingcart

    @codingcart

    4 жыл бұрын

    Thanks

  • @NehaKumari-tt1fn
    @NehaKumari-tt1fn4 жыл бұрын

    Nice explanation

  • @codingcart

    @codingcart

    4 жыл бұрын

    Thanks for liking

  • @chandansingh-hv9bl
    @chandansingh-hv9bl4 жыл бұрын

    Superb

  • @codingcart

    @codingcart

    4 жыл бұрын

    Thanks 🤗

  • @JohnCarrFitness
    @JohnCarrFitness3 жыл бұрын

    Did you ever update the code to have it automatically click 'block' on the chrome browser notification instead of you manually clicking it?

  • @mythm2063

    @mythm2063

    11 ай бұрын

    Did you find a solution for that??

  • @learnpythontogether4490
    @learnpythontogether44903 жыл бұрын

    Thank you "driver.switch_to.active_element" is a nice comment

  • @Daniel14Mejia
    @Daniel14Mejia3 жыл бұрын

    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

    @ananthsai1236

    3 жыл бұрын

    Hi , I am stuck at the same point.. You got anything.?

  • @jordy789
    @jordy7892 жыл бұрын

    Hello! can you create a video on how to create a bot on facebook user account not on page using python or js ?

  • @glenfreiboth3587
    @glenfreiboth35873 жыл бұрын

    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

    @mythm2063

    11 ай бұрын

    Hello any solution for that please?

  • @user-eh9nw3mz5u
    @user-eh9nw3mz5u3 жыл бұрын

    how to post a picture with selenium, not only text?

  • @faizan_khan660
    @faizan_khan6604 жыл бұрын

    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 😒😒😒

  • @lualmeidasouza
    @lualmeidasouza3 жыл бұрын

    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

    @harshmirdhwal

    2 жыл бұрын

    Your page Id in place of page id

  • @thantyazarhein
    @thantyazarhein2 жыл бұрын

    Hello, Would it still working in 2021

  • @codingcart

    @codingcart

    2 жыл бұрын

    Haven't tried, just give a try from your end😊

  • @okkymahardika748
    @okkymahardika7483 жыл бұрын

    sorry sir but how to make automatic post for facebook page and schendule?

  • @codingcart

    @codingcart

    3 жыл бұрын

    It was automatic..Are you asking anything different??

  • @_mandeep_kumar.
    @_mandeep_kumar.4 жыл бұрын

    So quick....

  • @codingcart

    @codingcart

    4 жыл бұрын

    :)

  • @renatofassarella4318
    @renatofassarella43183 ай бұрын

    is there any updated code?

  • @codingcart

    @codingcart

    3 ай бұрын

    No buddy, they updated their page layout

  • @AmeerulIslam
    @AmeerulIslam3 жыл бұрын

    will facebook ban me for this?

  • @codingcart

    @codingcart

    3 жыл бұрын

    No

  • @MarketingExperts1
    @MarketingExperts13 жыл бұрын

    #Jarveepro will help you schedule your posts to be automatically published at the most active time for most followers

  • @swadkasafar45
    @swadkasafar4510 ай бұрын

    complete waste of time and irrelevant code

  • @codingcart

    @codingcart

    10 ай бұрын

    It will not work for new Facebook interface