Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
html parser
#6
nilamo [b' Wrote: [/b]347' dateline='1521228699']
(Mar-16-2018, 06:13 PM)tjnichols Wrote: bsOb = BeautifulSoup(html.read())
print(bsObj.h1)

You define a variable named bsOb, but try to use one named bsObj. Those are not the same thing. I don't understand why these aren't the same - is it simply because I typed it wrong? Or are they two separate things that do two separate things?

(Mar-16-2018, 06:13 PM)tjnichols Wrote: BeautifulSoup(YOUR_MARKUP, "html.parser")
#snip
bsOb = BeautifulSoup(html.read, html.parser)
The message is very literal. html.parser isn't a thing that exists anywhere, but instead the string "html.parser" is a string that always exists.Is this something I should always use? If so, why? What does it do for me?

I truly appreciate your time and patience with me and your ability to break things down so I can understand them! Thank you!

(Mar-16-2018, 07:38 PM)metulburr Wrote: you should also use the requests module to get the html
Can you tell me how using the requests module helps me the html? I appreciate your help!
Reply


Messages In This Thread
html parser - by tjnichols - Mar-16-2018, 06:13 PM
RE: html parser - by snippsat - Mar-16-2018, 06:16 PM
RE: html parser - by nilamo - Mar-16-2018, 07:31 PM
RE: html parser - by tjnichols - Mar-17-2018, 05:08 PM
RE: html parser - by buran - Mar-16-2018, 07:31 PM
RE: html parser - by metulburr - Mar-16-2018, 07:38 PM
RE: html parser - by snippsat - Mar-17-2018, 05:55 PM
RE: html parser - by tjnichols - Mar-17-2018, 06:28 PM
RE: html parser - by tjnichols - Mar-17-2018, 08:43 PM
RE: html parser - by tjnichols - Mar-17-2018, 11:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  HTML multi select HTML listbox with Flask/Python rfeyer 0 4,701 Mar-14-2021, 12:23 PM
Last Post: rfeyer
  Easy HTML Parser: Validating trs by attributes several tags deep? runswithascript 7 3,640 Aug-14-2020, 10:58 PM
Last Post: runswithascript
  Python3 + BeautifulSoup4 + lxml (HTML -> CSV) - How to loop to next HTML/new CSV Row BrandonKastning 0 2,402 Mar-22-2020, 06:10 AM
Last Post: BrandonKastning
  Django field model for HTML parser? Drone4four 0 4,181 Nov-15-2017, 02:43 AM
Last Post: Drone4four

Forum Jump:

User Panel Messages

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