Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from bs4 import BeautifulSoup, SoupStrainer
- import httplib2
- import requests
- import lxml
- import os
- url = 'https://pastelink.net/2w1ne'
- http = httplib2.Http()
- response, content = http.request(url)
- response = requests.get('https://pastelink.net/2w1ne')
- if response.status_code != 200:
- print('Page not found')
- exit(1)
- print('Successfully fetched the page')
- links = []
- print('Scraping Links from ', url)
- for link in BeautifulSoup(content, features="lxml").find_all('a', href=True, target="_blank"):
- links.append(link['href'])
- for link in links:
- print(link)
- input('Press ENTER to exit')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement