Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need some help with parsing
#3
It's after he login with code as shown @Axel_Erfurt.

Send source to BS again.
home_page = s.get("https://connectedinvestors.com/friends-list")
#print(home_page.content)
bs_after_login = bs(home_page.content, "html.parser")
So than can parse like this.
>>> s = bs_after_login.find('a')
>>> s
<a href="/member/rudy-acosta" itemprop="url">
<figure class="circle profile bordered bordered-level-2">
<img alt="Rudy Acosta" itemprop="image" src="/uploads/user/15401/img_544bf971f23de.jpg"/>
</figure></a>
>>> 
>>> s.get('href')
'/member/rudy-acosta'
>>> 
>>> # img tag aslo have name
>>> img_tag = s.find('img')
>>> img_tag.attrs
{'alt': 'Rudy Acosta',
 'itemprop': 'image',
 'src': '/uploads/user/15401/img_544bf971f23de.jpg'}

>>> img_tag.attrs['alt']
'Rudy Acosta'
Reply


Messages In This Thread
Need some help with parsing - by jkessous - Jan-19-2020, 07:34 PM
RE: Need some help with parsing - by Axel_Erfurt - Jan-19-2020, 08:40 PM
RE: Need some help with parsing - by snippsat - Jan-19-2020, 09:37 PM
RE: Need some help with parsing - by jkessous - Jan-19-2020, 09:45 PM
RE: Need some help with parsing - by snippsat - Jan-19-2020, 10:04 PM
RE: Need some help with parsing - by jkessous - Jan-19-2020, 10:51 PM
RE: Need some help with parsing - by snippsat - Jan-20-2020, 12:44 AM
RE: Need some help with parsing - by jkessous - Jan-20-2020, 12:48 PM
RE: Need some help with parsing - by snippsat - Jan-20-2020, 06:12 PM
RE: Need some help with parsing - by jkessous - Jan-20-2020, 06:40 PM
RE: Need some help with parsing - by snippsat - Jan-21-2020, 12:18 AM
RE: Need some help with parsing - by jkessous - Jan-21-2020, 05:48 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020