SoulMazer
26
Posting Whiz in Training
Recommended Answers
Jump to PostYou could use HTMLParser like this
import sys if sys.version_info[0] < 3: from HTMLParser import HTMLParser from urllib2 import urlopen else: from html.parser import HTMLParser from urllib.request import urlopen class MyParser(HTMLParser): def __init__(self): HTMLParser.__init__(self) self.day = None def handle_starttag(self, tag, attrs): if tag == 'tr': for key, …
Jump to PostIf by unparsed HTML via script you mean get the source code for a page. Then you do that by using urllib
import urllib #This is a file like object. data = urllib.urlopen("www.daniweb.com") #So we have to read() it to get the text print data.read()
Hope that …
All 5 Replies
lllllIllIlllI
178
Veteran Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
SoulMazer
26
Posting Whiz in Training
lllllIllIlllI
178
Veteran Poster
SoulMazer
commented:
Very helpful and follows through
+2
SoulMazer
26
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.