Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need some help with parsing
#1
Hi Everyone,
First of all thanks for the assistance. I am a noob i python and need assistance with some website parsing.
The website requires a login which i managed to do and managed to print the page i needed (one of many).
the issue i have is that i am trying to parse the page and search for two specific things.

My code is
from requests import Session
from bs4 import BeautifulSoup as bs

 
with Session() as s:
    site = s.get("https://connectedinvestors.com/login")
    bs_content = bs(site.content, "html.parser")
    token = bs_content.find("input", {"name":"infusion_id"})["value"]
    login_data = {"email":"myemailaddress","password":"mypassword", "infusion_id":token}
    s.post("https://connectedinvestors.com/login",login_data)
    home_page = s.get("https://connectedinvestors.com/friends-list")
    print(home_page.content)
when i do the print i get entire page data which looks like this (just a sample)

i need to pull the name of the member and the user-id
it can be seen in this line
<a itemprop="url" href="/member/rudy-acosta">\n <figure class="circle profile bordered bordered-level-2">\n <img itemprop="image" src="/uploads/user/15401/img_544bf971f23de.jpg" alt="Rudy Acosta"/>\n


how it is clear.
thanks
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