Skip to content

Commit 589a946

Browse files
Added script
1 parent ffab0ae commit 589a946

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

fb.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import time
2+
import selenium
3+
from selenium import webdriver
4+
from bs4 import BeautifulSoup
5+
import requests
6+
import urllib.request
7+
import json
8+
import validators
9+
from selenium.webdriver.common.keys import Keys
10+
11+
12+
13+
def get_soup(url,header):
14+
return BeautifulSoup(urllib.request.urlopen(urllib.request.Request(url,headers=header)),'html.parser')
15+
16+
17+
header={'User-Agent':"Mozilla/6.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36"
18+
}
19+
20+
print("Facebook")
21+
22+
url = "https://facebook.com"
23+
24+
print(url)
25+
26+
27+
28+
driver = webdriver.Firefox()
29+
driver.get(url)
30+
31+
html_page = driver.page_source
32+
33+
soup = BeautifulSoup(html_page,'html.parser')
34+
print(soup.title.string)
35+
36+
eMail = input("Enter your email Id\n")
37+
pAss = input("Enter your password\n")
38+
39+
email = driver.find_element_by_name("email")
40+
email.send_keys(eMail)
41+
42+
password = driver.find_element_by_name("pass")
43+
password.send_keys(pAss)
44+
45+
46+
47+
start = driver.find_element_by_css_selector("#u_0_l")
48+
start.click()
49+
50+
time.sleep(5)
51+
pp = input("Enter your Status\n")
52+
53+
54+
55+
post = driver.find_element_by_xpath('//textarea[@class="uiTextareaAutogrow _3en1"]')
56+
post.send_keys(pp)
57+
58+
NEXT_BUTTON_XPATH = '//button[@type="submit" and @class="_42ft _4jy0 _ej1 _4jy3 _4jy1 selected _51sy" and @value="1"]'
59+
button = driver.find_element_by_xpath(NEXT_BUTTON_XPATH)
60+
button.click()
61+
62+
# Click_BUTTON_XPATH = '//form[@method="post" and @name="formNTQxNTQ1"]/input[2]'
63+
# _inputs = driver.find_element_by_xpath(Click_BUTTON_XPATH)
64+
# _inputs.click();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy