Issue
I am trying to scrape a list of trade publications from: https://www.webwire.com/IndustryList.asp
, using beautifulsoup and requests. When I inspect the page contents with my browser, I see a list:
<ul id="syndication-list">
<li>15 Minutes More Productions</li>
<li>AAA Go Magazine</li>
<li>AAA Going Places</li>
<li>AAA Motorist</li>
</ul>
But when I use requests
, the list is empty, and I only see:
</ul></div>
How can I scrape the items in the list?
import requests
page = requests.get('https://www.webwire.com/TradePublications.asp?ind=LEI')
print(page.text)
Solution
It's working
import requests
from bs4 import BeautifulSoup
url = "https://www.webwire.com/TradePublications.asp?ind=LEI"
page = requests.get(url)
#print(url)
soup = BeautifulSoup(page.content, 'html.parser')
for e in soup.select('#syndication-list li'):
print(e.get_text())
Output:
101 North Magazine (Gannett Pacific Publications)
15 Minutes More Productions
AAA Go Magazine
AAA Going Places
AAA Motorist
AAA World
AAHOA Lodging Business Magazine
Adfax
Admark Marketing Report
Adweek
African Americans on Wheels magzine
Agent@Home magazine
Air Transport World Magazine
Airguide Magazine & AirguideOnline.com
AIRS
Alaska Airlines Magazine
America West Magazine
American Executive magazine
American Express Publishing
American Fitness
American Media
American Profile
AMERICAN ROAD MAGAZINE
American Salon Magazine
American Saver Magzine
Answered By - F.Hoque
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.