hai i am new to python, can any one please help me how to parse data from an html file,
i want to display the content which lies under a particular tag,and also can you please tell where can i find tutorials for this topic with sample examples.
sravi.pearl 0 Newbie Poster
Recommended Answers
Jump to PostPython has 2 very good 3 party parser BeautifulSoup and lxml.
This parser can handle html that is no good,this can be important.
An example with BeautifulSoup.
We want the price of beans from this site.
http://beans.itcarlow.ie/prices.htmlfrom BeautifulSoup import BeautifulSoup import urllib2 #Read in …
Jump to PostRead this post by bobince why regex is a very bad idèe when it`s come to parse (x)html.
It`s one of the best answer on stackoverflow.
http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tagsFor small website is it`s possibly …
Jump to PostYou have to read about regex,there is no way to explain it a short way.
http://docs.python.org/library/re.htmlJust one more example a text where a take out price.
\$ match $
\d match any number.
. matches …
All 12 Replies
griswolf 304 Veteran Poster
sravi.pearl 0 Newbie Poster
griswolf 304 Veteran Poster
snippsat 661 Master Poster
sravi.pearl 0 Newbie Poster
sravi.pearl 0 Newbie Poster
griswolf 304 Veteran Poster
sravi.pearl 0 Newbie Poster
snippsat 661 Master Poster
sravi.pearl 0 Newbie Poster
snippsat 661 Master Poster
griswolf 304 Veteran Poster
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.