ianshier 1 Posted July 31, 2014 Report Share Posted July 31, 2014 Hello mates.I didn't find answer for this question.How to scrape an attribute, for example <onclick="javascript:go('http://yourpage.com/onclick.php?', 'demo'); return false;">How to scrape only this yourpage.com/onclick.php? ? or what about this thing(if found only few sites with this) onclick="startLead(this, '/redirect--wufoD0qauiXpTlPsx8v6iNdOzn/Kp9UvRYZsYLF9R4skvUMzZAf78/Z6lP2NGfuJrtALnI4N0vVn1/XpA9cA4f3SF1Oaf1Cdu91O5wpi+1jv4pxZUD8u8W6MAvO3Lq2VZ4/9YOIg97tW5T5LhgNMCivyrjIJ431lgeAOwz+hg8s7qc7ADnwVoiMsyV2V5uDh5BGQosgXP3WjbYI11oSlRu3veZBR6nOqNi5PmBFI1jczchQTh8aldKaWLmTfbBMl'); Thanks for reply! Is it even possible to do? Quote Link to post Share on other sites
Bot-Factory 602 Posted July 31, 2014 Report Share Posted July 31, 2014 Hello mates.I didn't find answer for this question.How to scrape an attribute, for example <onclick="javascript:go('http://yourpage.com/onclick.php?', 'demo'); return false;">How to scrape only this yourpage.com/onclick.php? ? or what about this thing(if found only few sites with this) onclick="startLead(this, '/redirect--wufoD0qauiXpTlPsx8v6iNdOzn/Kp9UvRYZsYLF9R4skvUMzZAf78/Z6lP2NGfuJrtALnI4N0vVn1/XpA9cA4f3SF1Oaf1Cdu91O5wpi+1jv4pxZUD8u8W6MAvO3Lq2VZ4/9YOIg97tW5T5LhgNMCivyrjIJ431lgeAOwz+hg8s7qc7ADnwVoiMsyV2V5uDh5BGQosgXP3WjbYI11oSlRu3veZBR6nOqNi5PmBFI1jczchQTh8aldKaWLmTfbBMl');Thanks for reply! Is it even possible to do?What exactly do you want to extract? Just the url in the first example?You could use regex to do that. set(#tmp1, "<onclick=\"javascript:go(\'http://yourpage.com/onclick.php?\' \'demo\'); return false;\">", "Global")alert($find regular expression(#tmp1, "(?<=go\\(\\\').+?(?=\\?\\\')")) CheersDan Quote Link to post Share on other sites
ianshier 1 Posted August 1, 2014 Author Report Share Posted August 1, 2014 Thank you Dan.What about second link?There is encoded url, and it's working normal on webbrowser like chrome(when you try to click it's opening as new tab, and is redirecting)what about this? Quote Link to post Share on other sites
Bot-Factory 602 Posted August 1, 2014 Report Share Posted August 1, 2014 Thank you Dan.What about second link?There is encoded url, and it's working normal on webbrowser like chrome(when you try to click it's opening as new tab, and is redirecting)what about this? I would have to see the site to give you an answer on this one. Can you share the url? Dan Quote Link to post Share on other sites
ianshier 1 Posted August 1, 2014 Author Report Share Posted August 1, 2014 Yes, but can I send you it somewhere?I don't want to post it publicly. Quote Link to post Share on other sites
Bot-Factory 602 Posted August 1, 2014 Report Share Posted August 1, 2014 Yes, but can I send you it somewhere?I don't want to post it publicly. Sent you a PM. Dan Quote Link to post Share on other sites
Bot-Factory 602 Posted August 1, 2014 Report Share Posted August 1, 2014 onclick="startLead(this, '/redirect--wufoD0qauiXpTlPsx8v6iNdOzn/Kp9UvRYZsYLF9R4skvUMzZAf78/Z6lP2NGfuJrtALnI4N0vVn1/XpA9cA4f3SF1Oaf1Cdu91O5wpi+1jv4pxZUD8u8W6MAvO3Lq2VZ4/9YOIg97tW5T5LhgNMCivyrjIJ431lgeAOwz+hg8s7qc7ADnwVoiMsyV2V5uDh5BGQosgXP3WjbYI11oSlRu3veZBR6nOqNi5PmBFI1jczchQTh8aldKaWLmTfbBMl'); Ok, I looked at the website you showed me. On this site there are 81 links who point to differnet sites. Now to click one of those links you need a combination of click with wildcard and element offset. So in your case the element to search for is:onclick=w"startLead*" All of the links have an onclick atribute. And the all start with startLead Now if you want to navigate to all of them, it would be best to add those links into a list. With list from text. But if you want to navigate to one of them directly, you could also use element offset:click($element offset(<onclick=w"startLead*">, 0), "Left Click", "No") Which will click on the first link in your case. Hope that helps.Dan Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.