Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drill Thru Web Page?

Status
Not open for further replies.

Fnurky

Programmer
Sep 8, 2002
19
AU
I'm wondering if this is possible using VB?

I want to be able to grab a link that is on a web page, but the only way I can get to that page is by going thru another one first.

E.g. Using IE, I navigate to page A, which has a button on it that I click to go to page B, which has the link I want.

If I put the URL of page B into my VB prog, it still sends me to Page A. Can I do something that, once I've resolved link A, then lets me continue on to Page B and grab the link?

Hope that wasn't too confusing!!
 
Yes you can do that...
But there are several different ways depending on the context...

to give an acurate answer would require seeing the source of the target pages...

First off, do you have any experience in working with the WebBrowser control?
 
Also, is this a one time thing or are there many pages that you want to do this to at once, in a sort of a batch operation...?

If so, can you just right click and view the source to get the link?

If not, I posted some code a while back to let you view the source of pages that are otherwise blocked.

For starters, Check out thread: thread222-934916
 
Thanks for the reply.

Firstly, we use Mcafee (can I mention names?) anti-virus. Periodically (once a week, unless there are extra releases) we are sent an email informing us that the new dat files have been released, and a link to their site. The actual page to download the dat file has a unique url containing the date and time they posted the file. To get to that page you have to go through 2 other pages, both of which have static URL's.

I've never used the WebBrowser control. I'll check out the thread to see if it answers my question.

Cheers
 
Nup - couldn't seem to make much of it. I could surely do with some more info on how I would use the WebBrowser control in this instance.

Please.....
 
You do realise that McAfee has an autoupdate function you can enable that downloads the DAT files directly and installs them for you?
 
I do, but from a corporate view we don't want each users pc downloading the file. We use ePolicy to update client pc's but we need the dat file for the servers because they're locked down and we don't allow software to automatically install on them.
 
so do you have to have a userid & password to get to the target site? or can you post the link?

If you need a password... such as for this page:

which basically (after you cut out all of the clutter well 80 lines of it ;-)) has this form:
Code:
<form action="Login.asp" method="post" id="LoginForm" name="LoginForm">
    <div id="contentMain">
        <input type="hidden" id="SUBMITTED" name="SUBMITTED" value="1" />
        <input type="text" id="UserID" name="UserID" value="" style="width:175px" />
        <input type="password" id="Password" name="Password" value="" style="width:175px" />
        <input type="checkbox" id="RememberMe" name="RememberMe" />
        <input type="submit" id="submit1" name="submit1" value="  Log In  " style="font-size:11px" />
    </div>
</form>

So to fill out, and submit the form should look something like this:
Code:
Const User = "SomeUser"
Const Pass = "SomePass"

Private Sub Command1_Click()
  wb1.Navigate2 "[URL unfurl="true"]http://us.mcafee.com/root/login.asp"[/URL]
  Do: DoEvents: Loop Until wb1.ReadyState = READYSTATE_COMPLETE
  wb1.Document.Forms("LoginForm").elements("UserID").Value = User
  wb1.Document.Forms("LoginForm").elements("Password").Value = Pass
  wb1.Document.Forms("LoginForm").elements("submit1").Click
End Sub

You can then get the link off of the page...

You might need to put something like this in the Navigate Complete event to check for the target url...
 
>we don't allow software to automatically install on them

Sure, but if you really don't want to use ePolicy to distribute updates then you can at least get it to automatically download the DAT files for you to a local repository, and then distribute them manually.

Alternatively, you can look up the names for the sites used by ePO to get the DATs and do the whole thing manually

The point being that you do not need to go through the human-friendly sites, thus avoiding any button pressing or drill-down


here are a couple of the remote NAI repositories that you can pull DATs down from:

ftp://ftp.nai.com/pub/antivirus/datfiles/4.x/<latest_dat_file>

 
You guys are pretty good!! I knew there was a reason I came here!!! I'll take cube101's advice and go for strongm's solution.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top