Note that there are some explanatory texts on larger screens.

plurals
  1. POpython, collecting links / script values from page
    text
    copied!<p>I am trying to make a program to collect links and some values from a website. It works mostly well but I have come across a page in which it does not work.</p> <p>With firebug I can see that this is the html code of the illusive "link" (cant find it when viewing the pages source thou):</p> <pre><code>&lt;a class="visit" href="/tet?id=12&amp;mv=13&amp;san=221"&gt; 221 &lt;/a&gt; </code></pre> <p>and this is the script:</p> <pre><code>&lt;td&gt;&lt;a href=\"/tet?id=12&amp;mv=13&amp;san=221\" class=\"visit\"&gt;221&lt;\/a&gt;&lt;\/td&gt;&lt;\/tr&gt; </code></pre> <p>I'm wondering how to get either the "link" ("/tet?id=12&amp;mv=13&amp;san=221") from the html code and the string "221" from either the script or the html using selenium, mechanize or requests (or some other library)</p> <p>I have made an unsuccessful attempt at getting it with mechanize using the br.links() function, which collected a number of links from the side, just not the one i am after</p> <p>extra info: This might be important. to get to the page I have to click on a button with this code:</p> <pre><code>&lt;a id="f33" class="button-flat small selected-no" onclick="qc.pA('visitform', 'f33', 'QClickEvent', '', 'f52'); if ($j('#f44').length == 0) { $j('f44').style.display='inline'; }; $j('#f38').hide();qc.recordControlModification('f38', 'DisplayStyle', 'hide'); document.getElementById('forumpanel').className = 'section-3'; return false;" href="#"&gt; load2 &lt;/a&gt; </code></pre> <p>after which a "new page" loads in a part of the window (but the url never changes)</p>
 

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