Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to get the link from the server when the download button is clicked.


HTML
<div class="limit_down">
      <a href="javascript:;" class="down_t" onclick="env.downloadVideo(35678);return false;">
        
        Download
      </a>
    </div>


I'm using Selenium Chrome in Python.

Please just help me. Thanks


What I have tried:

Using selenium Python

Python
content = driver.find_element(
                By.XPATH, '//a[@class="down_t"]').get_attribute("value")
Posted
Updated 2-Jul-22 18:32pm

1 solution

Should be

content = driver.find_element(
                By.XPATH, '//a[@class="down_t"]').get_attribute("value")
 
Share this answer
 
v3
Comments
Member 14365635 3-Jul-22 5:47am    
'WebElement' object has no attribute 'getAttribute'
Member 15678123 3-Jul-22 5:51am    
updated the code
Member 14365635 3-Jul-22 5:56am    
I tried before and return value is None
Member 14365635 3-Jul-22 5:57am    
This is the website I'm working on:

https://lovepik.com/video-46749/rainy-ground.html
Member 14365635 3-Jul-22 6:02am    
When I try:
video_content = driver.find_element(By.XPATH, '//a[@class="down_t"]').click()


IDM Download software caught the link like this:


https://proxy-vip.lovepik.com/vfiles/video/05/96/21/a_b6UvDGkEAUXI1555059621.mp4?auth_key=1656843450-0-0-7cf98c32be7ae767c92ec7e5cbdfe08a

I want to get that link to output the Input box

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900