Welcome, Guest. Please Login.
IRobotSoft Robot
07/22/19 at 14:20:13
News: Welcome to the IRoboSoft Visual Web Scraping and Web Automation forum.
Home Help Search Login
Google
 


Pages: 1
Send Topic Print
Automatically Download File (Read 10587 times)
tobor_ky
Junior Member
**


I Love IRobotSoft

Posts: 25
Automatically Download File
12/29/10 at 12:18:17
 
I have iRobot click a link that will download a file.  At that point I am stopped by a "Download File" dialog box.  Is there a way to have iRobot automatically download a file when the download link is clicked instead of putting up the dialog box?
 
Thanks
Back to top
 
 
  IP Logged
tobor_ky
Junior Member
**


I Love IRobotSoft

Posts: 25
Re: Automatically Download File
Reply #1 - 12/29/10 at 13:02:33
 
Their is a function to download a file with the file's URL location.  SaveUrlFile( URL, FileName ) where URL is the filelocation URL and FileName is the name of the file that you are saving to.
Back to top
 
 
  IP Logged
tobor_ky
Junior Member
**


I Love IRobotSoft

Posts: 25
Re: Automatically Download File
Reply #2 - 12/29/10 at 14:18:47
 
I think the URL for the file is hidden?  The HTML code for the button is:
 
<a class="originButton  ui-priority-primary  view-on-max action-download" href="#"><span><span>Download Records</span></span></a>
 
I tried using SaveUrlFile( 'http://www.referenceusa.com/UsBusiness/Download/3bb8fdb7dfb54774babe0daf8ea0b217#', 'ReferenceUSA 111150.txt' )
 
where "http://www.referenceusa.com/UsBusiness/Download/3bb8fdb7dfb54774babe0daf8ea0b217" is the page that contains the "Download Records" button and then I just added the # to the end.
 
When I run the function it saves the source code for the page to the file.
Back to top
 
 
  IP Logged
IRobotSoft Administrator
IRobotSoft Administrator
*****


IRobotSoft, the Best
Internet Robot
System

Posts: 1608
Gender: male
Re: Automatically Download File
Reply #3 - 12/29/10 at 14:34:13
 
Yes, it seems the link URL is hidden.   Will it show up when you mark the link text and use menu: Tools -> HTML -> Selected Source?    
 
If it still does not show up the actual link, then you may have to follow the Method 2 in this post: http://irobotsoft.org/bb/YaBB.pl?num=1241115591
Back to top
 
 

The Administrator.
WWW   IP Logged
tobor_ky
Junior Member
**


I Love IRobotSoft

Posts: 25
Re: Automatically Download File
Reply #4 - 12/29/10 at 20:14:03
 
It doesn't show up when I use the HTML Selected source.  But the second method using the SendAppKeysWait function works.  However after the file downloads I have an "Alert Messages!" box pop up.
 
Type is "Navigation Timeout"
Info1 is "From: http://www.referenceusa.com/UsBusiness/Download/5acf66bd9fb24db48d840622cb635461"
Info2 is "To: Click:<DIV (ID='container')>1.<DIV (CLASS='contentLeftEdge')>1.<DIV (CLASS='contentRightEdge')>1.<DIV (CLASS='pageArea')>1.<DIV (ID='content')>1.<FORM (Name='download')>1.<A (CLASS='originButton ui-priority-primary view-on-max action-download')>1.<SPAN>1.<SPAN>1"
 
It isn't stopping the file from downloading but it pops up every time I look at a property of a task or try to edit any part of the robot.  Is there a something I should do differently?
 
Thanks,
 
Back to top
 
 
  IP Logged
IRobotSoft Administrator
IRobotSoft Administrator
*****


IRobotSoft, the Best
Internet Robot
System

Posts: 1608
Gender: male
Re: Automatically Download File
Reply #5 - 12/29/10 at 21:01:59
 
That is just some warning message.  You can use menu: Windows -> Close All to clear it.   It will not affect the robot execution.  
 
 
Back to top
 
 

The Administrator.
WWW   IP Logged
Pages: 1
Send Topic Print