Last active
September 12, 2019 10:33
-
-
Save ProgramFilesx86/d6cdc91b0b11f0916b6fe8be8be224aa to your computer and use it in GitHub Desktop.
My f1st dictionnary att
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import bs4 as bs | |
with requests.session() as c: | |
link="https://www.facebook.com/login.php?login_attempt=1&lwv=110" #link of the webpage to be logged in | |
initial=c.get(link) #passing the get request | |
login_data={"email":"xxxxxxxxxxxx","pass":"**********"} #the login | |
page_login=c.post(link, data=login_data) | |
#print(page_login) #checking status of requested page | |
page=c.get("https://www.facebook.com/profile.php?id=100008551898809") #requesting source code of logged in page | |
good_data = bs.BeautifulSoup(page.content, "lxml") #parsing it with BS4 | |
print(good_data.title) #printing this gives the title that is got from the page when accessed from an logged-out account | |
with requests.session() as b: | |
link2="https://www.facebook.com/login.php?login_attempt=1&lwv=110" #link of the webpage to be logged in | |
initial=b.get(link2) #passing the get request | |
login_data2={"email":"xxxxxxxxxxx","pass":"*****"} #the login | |
page_login2=b.post(link2, data=login_data2) | |
#print(page_login2) #checking status of requested page | |
page2=b.get("https://www.facebook.com/profile.php?id=100008551898809") #requesting source code of logged in page | |
good_data2 = bs.BeautifulSoup(page2.content, "lxml") #parsing it with BS4 | |
print(good_data2.title) #printing this gives the title that is got from the page when accessed from an logged-out account |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment