Sending entire HTML or just links.

15 views
Skip to first unread message

Slavko Kocjancic

unread,
Mar 29, 2013, 7:06:12 AM3/29/13
to greasemon...@googlegroups.com
Hello...

The folowing script send all <a href...> to local server where is saved to file.
The problem is that I cant manage to extend that.

for example there is one link of my interest.

 <a href="/xxxx/xxxxx_xxxxxxx.aspx?guid=78316a46-9dd2-4444-ae75-636436de55788d5c" class="lnk  "><span>Some text here</span></a>

So I wan't to POST just links wich have "a href" and the <span> element is present.
In addition I wan't to pass entire text betwen <a and /a>


//Send all url's to server
var allLinks, thisLink;
allLinks = document.evaluate("//a[@href]",document, null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < allLinks.snapshotLength; i++) {
  thisLink = allLinks.snapshotItem(i);
  GM_xmlhttpRequest({
    method: 'POST',
    url: 'http://127.0.0.1/vaje/test/test.php',
    headers: {'Content-type': 'application/x-www-form-urlencoded'},
    data: 'par='+lines[i],
    onload: function(responseDetails) {}
  });
};



LWChris@LyricWiki

unread,
Apr 1, 2013, 2:03:44 PM4/1/13
to greasemon...@googlegroups.com
Why would you want to log links to a server?
It looks like you're writing a script to exploit somebody by sending his
session links to you so you can use them.

You could perfectly see from

<a href="/shop/order_091bc7a.aspx?guid=78316a46-9dd2-4324-ae75-636436de55788d5c" class="lnk"><span>Buy item</span></a>

what the link does.

I won't support until I know what exactly you're doing here.

Chris

Slavko Kocjancic

unread,
Apr 1, 2013, 2:59:00 PM4/1/13
to greasemon...@googlegroups.com
I managed to save complete page to server and then crunch in other program.
I just need that link to open the page and extract coordinate in the
page to send in my GPS receiver. Is just to tedious to make hunderd
clicks to got 25 coordinates... So I automate it... :D
and link like "Buy item" is not god and is thrown away. Ićm focused on
link with Geocache here...

So this problem is solved other way.
Reply all
Reply to author
Forward
0 new messages