Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IntGetFile from URL generated by Server script.
#1
I'm not sure I'll be able express this very well or if I'll be able to get any help, but I'll give it a shot.

I need to download MP3 files from a website that posts new files every week. I've been trying to automate the process without just automating a web browser.

I've gotten pretty close. Actually I can do it, except for one part...so here's my explanation.

Here's the code that works:
Function Function68
Code:
Copy      Help
out
int Number=2182804
str ID="30R10080"
rep 9
,_i+1
,str localfile.format("$desktop$\%s%i.mp3" ID _i)
,out localfile
,str s="http://xxxxxxx.asp?wci=download&hformstate_action=%i&hpackagenumber_session=%i&hformstate_session=04C63D7C-8294-4B55-97CD"
,_s.format(s Number Number)
,IntGetFile _s localfile 16 0 1
,Number+1

See, the Number variable and the ID variable change each week. The ID variable is coded by week and I have that number from a production order. The Number variable is some sort of counter variable used by the company. Since they handle a lot of changing accounts this number is essentially random, it does always increase...but by what? there's no way of predicting. Sometimes the files are not even sequential for a week.

What I need to do is be able to know what the Number value is based on the webpage html.
I can get the HTML for the page right before the page I need that contains the MP3 link information:
http://xxxxxxxxx.asp?wci=thingstodo&wce ... -4B55-97CD

From that URL I can get the html to get the link to the download page which is:
javascript:tS('g2209232')
I'm not sure what can be done with the javascript?

So when I click on the javascript link the browser goes to the download page with the URL:
http://xxxxxxxxx.asp?WCI=thingstodo&WCE=Action

Of course it all works when going from the previous ?wci=thingstodo&wce=04C63D7C-8294-4B55-97CD page where it takes me to the right page with the MP3 downloads, but when I go at it from any other angle (like QM) it is just generic server URL that doesn't contain the HTML I am looking for the obtain the MP3 download link information.

It basically boils down to what can be done with that javascript link, if anything. I don't know enough about how webages work, and then how to work with them through QM to figure this out on my own. So like I said, I'm not sure if anyone can help me with this, especially since I don't want to post actually working data because this is a website I use for work. Possibly any point in the right direction might guide me to a solution.

Thanks,
jimmy Vig


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)