I have no solution really. In my experience html is a bit too variable. I can't find anything DBI-ey (also looked in https://pgxn.org/ - no luck ). Of course, to get database-access you could slurp either html (via curl) or cleaned-up text (via links -dump) into a table but they'd just be 'raw' lines that you'd still have to select the correct table rows from. Still, for well recognizable/greppable rows it might work. And anyway, it is a reminder that postgresql's COPY knows how to read input from another program's STDOUT.
create table temp_slurps (line text);
copy temp_slurps ( line ) from program 'links -dump -width 512 ${url}'
+;
select * from temp_slurps ; -- where ...
As they say, YMMV. I'm sure if you write a postgres extension (for pgxn.org) to extract-'read' html-tables from source it will be popular ;)
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|