Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import bs4 as bs
- login_url = "__withheld__"
- target_url = "__withheld__"
- login_data = { "username": "my_username", "password": "my_password"}
- with requests.Session() as s:
- page = s.get(login_url)
- page_login = s.post(login_url, data = login_data)
- page = s.get(target_url)
- final_page = bs.BeautifulSoup(page.content, 'lxml')
- print(final_page.title)
- <input name="username" type="text" id="username" class="metro-input" placeholder="Username" value="">
- <span id="username-error" class=""></span>
- <label class="ie789Only"> Password</label>
- <input name="password" type="password" id="password" class="metro-input" placeholder="Password">
- <input type="submit" name="button1" value="Sign in" id="button1" class="metro-button">
- import requests
- import bs4 as bs
- username = 'username of the site'
- password = 'password of the site'
- req = requests.get(login_url, auth=(username, password))
- final_page = bs.BeautifulSoup(req.content, 'lxml')
- print(final_page.title)
Add Comment
Please, Sign In to add comment