Giter VIP home page Giter VIP logo

bot-comments-facebook-selenium's Introduction

๐Ÿค– Many comments on a Facebook post with Selenium

  1. Install:
  1. Download marionette or driver for your browser:
  1. Move it to:
/usr/local/bin
  1. Code:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.common.exceptions import NoSuchElementException

driver = webdriver.Firefox()
driver.get('https://www.facebook.com/')
print
"Opened facebook..."
a = driver.find_element_by_id('email')
a.send_keys('YOUR_EMAIL_HERE')
print
"Email Id entered..."
b = driver.find_element_by_id('pass')
b.send_keys('YOUR_PASSWORD_HERE')
print
"Password entered..."
c = driver.find_element_by_id('loginbutton')
c.click()
print
"Go to post..."
driver.get("https://m.facebook.com/RafAPacHukO/posts/3802972933077744")
sleep(3)

def comment():
    ins = driver.find_element_by_id('composerInput')
    ins.send_keys('YOUR_COMMENT_HERE')
    ins = driver.find_elements_by_tag_name('input')
    for x in ins:
        if 'Comentar' in x.get_attribute('value'):
            x.click()
            return

while True:
    comment()
    sleep(2)

PS:

bot-comments-facebook-selenium's People

Contributors

guatemuz avatar memolopezmx avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.