Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Sounds like you really just want to parse HTML, I recommend looking at any of the wonderful packages for doing so:</p> <ul> <li><a href="http://crummy.com/software/BeautifulSoup" rel="nofollow noreferrer">BeautifulSoup</a></li> <li><a href="http://codespeak.net/lxml/lxmlhtml.html" rel="nofollow noreferrer">lxml.html</a></li> <li><a href="http://code.google.com/p/html5lib/" rel="nofollow noreferrer">html5lib</a></li> </ul> <p>Or! You can use a parser like one of the following:</p> <ul> <li><a href="http://pyparsing.wikispaces.com" rel="nofollow noreferrer">PyParsing</a></li> <li><a href="http://dparser.sourceforge.net/" rel="nofollow noreferrer">DParser</a> - A GLR parser with good python bindings.</li> <li><a href="http://www.antlr.org" rel="nofollow noreferrer">ANTLR</a> - A recursive decent parser generator that can generate python code.</li> </ul> <p>This example is from the BeautifulSoup <a href="http://www.crummy.com/software/BeautifulSoup/documentation.html" rel="nofollow noreferrer">Documentation</a>:</p> <pre><code>from BeautifulSoup import BeautifulSoup, SoupStrainer import re links = SoupStrainer('a') [tag for tag in BeautifulSoup(doc, parseOnlyThese=links)] # [&lt;a href="http://www.bob.com/"&gt;success&lt;/a&gt;, # &lt;a href="http://www.bob.com/plasma"&gt;experiments&lt;/a&gt;, # &lt;a href="http://www.boogabooga.net/"&gt;BoogaBooga&lt;/a&gt;] linksToBob = SoupStrainer('a', href=re.compile('bob.com/')) [tag for tag in BeautifulSoup(doc, parseOnlyThese=linksToBob)] # [&lt;a href="http://www.bob.com/"&gt;success&lt;/a&gt;, # &lt;a href="http://www.bob.com/plasma"&gt;experiments&lt;/a&gt;] </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload