Created
September 10, 2014 01:58
-
-
Save alecxe/a4e99a79f0afa60cc52b to your computer and use it in GitHub Desktop.
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 | |
from bs4 import BeautifulSoup | |
urls = ["https://www304.americanexpress.com/credit-card/compare"] | |
for url in urls: | |
website = requests.get(url) | |
soup = BeautifulSoup(website.content) | |
print(''.join([element.text for element in soup.body.find_all(lambda tag: tag != 'script', recursive=False)])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment