0

i am try to parse a link which is hidden in herf = javascript:void(0) and get link button is disable class="btn btn-success btn-lg get-link disabled". after some second link is appear <a href="http://googledrivedirectlink.xyz/download.php?id=QllDSWJsSGV1M3RRd0c3N1o0QmVWdUpoZVdJUjZ4ZE9iWkx6ZHgvZllmNlc=" class="btn btn-success btn-lg get-link">Get Link</a>. how i can solve this how i can use Selenium for parse href link

i have already tried it with BeautifulSoup but its not working nothing show its say

<a href="javascript: void(0)" class="btn btn-success btn-lg get-link disabled">
  Please wait...        
</a>

how i can resolve it

here is my code

import requests
from bs4 import BeautifulSoup
url=requests.get('http://linkblend.icu/p8AzvIvi').text
soup=BeautifulSoup(url,'html.parser')
soup.findAll('a')

Here is my code output

<a href="javascript: void(0)" class="btn btn-success btn-lg get-link disabled">
  Please wait...    
</a>
usama riaz
  • 16
  • 6
  • So, what are you trying to get exactly? What is your desired output? – FailSafe Mar 24 '19 at 10:00
  • Following link can help you I guess: https://stackoverflow.com/questions/8049520/web-scraping-javascript-page-with-python Basically you need to wait for the Javascript of the page to run completely before reading the link href – Keerthi Kumar P Mar 24 '19 at 10:10
  • thanks for reply. sir i want href link which i have described . using parsing in python. – usama riaz Mar 24 '19 at 10:11
  • @KeerthiKumarP thanks for reply. yeah i want to make some wait requests for javascript for rum completely . for getting href link.. but how i can get it with code in python please have you some idea – usama riaz Mar 24 '19 at 10:14
  • Yeah, the link in my comment has many options for that. Particularly this answer seems to be clear: https://stackoverflow.com/a/26440563/6016779 Kindly try them and raise a separate thread if you have any issues in them. – Keerthi Kumar P Mar 24 '19 at 10:49
  • Here's the thing, if you're literally trying to get `"javascript: void(0)"` that's easy, but that's not a "link." If you're trying to get a link, yea, @"Keerthi Kumar P"'s advice will first need to be taken into account and Python libraries can assist, but I find that both Beautiful Soup and Selenium often fail to find the right tags especially when unicode characters are involved so I often use regex and pass what I find back in. You can try this: `re.findall('href=\"([\S]+)\"(?=\s|$)', url)`. BTW `url` in your code is a string. – FailSafe Mar 24 '19 at 10:52
  • sorry sir its not working :( – usama riaz Mar 24 '19 at 12:07
  • Wait, what? Are you waiting for everything to load as said? I just test this in Python like this `>>> import re` set part of your sample to a variable "url" `>>> url = '''href="http://googledrivedirectlink.xyz/download.php?id=QllDSWJsSGV1M3RRd0c3N1o0QmVWdUpoZVdJUjZ4ZE9iWkx6ZHgvZllmNlc=" class="btn btn-success btn-lg get-link">Get Link'''` ------------------------------ Ran it against the regex and got this result `>>> re.findall('href=\"([\S]+)\"(?=\s|$)', url)` `#RESULT: ['http://googledrivedirectlink.xyz/download.php?id=QllDSWJsSGV1M3RRd0c3N1o0QmVWdUpoZVdJUjZ4ZE9iWkx6ZHgvZllmNlc=']` – FailSafe Mar 24 '19 at 13:01
  • no sir this is url where i want to get href link from this link `'url= http://linkblend.icu/p8AzvIvi'` . when i open this link its still load for 3 second after 3 second its appear replace of `"javascript: void(0)"`. but its not able to parse – usama riaz Mar 24 '19 at 13:27
  • Sir you just open url which i mention uper comment and check inspect of getlink button.u will understand my problem – usama riaz Mar 24 '19 at 13:34

0 Answers0