?
Solved

Any way to get all the save target as links to a file

Posted on 2007-10-01
12
Medium Priority
?
509 Views
Last Modified: 2011-09-20
Hi,

Say if i am on EE page and there anr many links Can i get all these to a  file.
Say i have opened Q's need to get all these names(The full Http path) to a file.


Regards
SHarath
0
Comment
Question by:bsharath
  • 5
  • 5
  • 2
12 Comments
 
LVL 9

Expert Comment

by:JonMny
ID: 19997881


      Dim IeDoc As Object
        'Create new instance of IE
        Dim ieapp As Object = CreateObject("InternetExplorer.Application")
        'Make it visible - some things dont work
        'unless its visible
        ieapp.Visible = True
        'define the page to open
        Dim sURL As String = "www.yahoo.com"
        'navigate to the page
        ieapp.Navigate(sURL)
        'Pause the macro using a loop until the
        'page is fully loaded
        Do
        Loop Until ieapp.ReadyState = 4 ' READYSTATE_COMPLETE
        'store the Document object
        IeDoc = ieapp.Document
        For d As Integer = 0 To ieapp.Document.All.tags("a").Length
            My.Computer.FileSystem.WriteAllText("C:\Test.txt", IeDoc.Links(d).href & vbCrLf, True)
        Next
0
 
LVL 11

Author Comment

by:bsharath
ID: 19999757
Is this a Vbs script...
0
 
LVL 9

Expert Comment

by:JonMny
ID: 19999783
It's VB.Net, converted from a vbs
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 11

Author Comment

by:bsharath
ID: 19999894
Sorry to ask how should i run this..
I saved the code as "Filename.vbs" But gives an error.

0
 
LVL 9

Expert Comment

by:JonMny
ID: 20000079
The code is vb.net if you want to make a vbs file  use this

    Dim sURL
    Dim IeDoc
    Dim i

Const ForAppending = 8


set objFSO = CreateObject("Scripting.FileSystemObject")

set objFile = objFSO.OpenTextFile("C:\testa.txt", ForAppending, True)




    'Create new instance of IE
    Set ieapp = CreateObject("InternetExplorer.Application")
   
    'Make it visible - some things dont work
    'unless its visible
    ieapp.Visible = True
        'define the page to open
    sURL = "www.yahoo.com"
    'navigate to the page
    ieapp.Navigate sURL
    'Pause the macro using a loop until the
    'page is fully loaded
    Do
    Loop Until ieapp.ReadyState = 4 ' READYSTATE_COMPLETE
    'store the Document object
    Set IeDoc = ieapp.Document
   For d = 0 To ieapp.Document.All.tags("a").Length

objFile.WriteLine(IeDoc.Links(d).href)



    Next
objFile.Close




0
 
LVL 11

Author Comment

by:bsharath
ID: 20000161
I get this...

---------------------------
Windows Script Host
---------------------------
Script:      C:\Documents and Settings\sharathr\Desktop\Get all links.vbs
Line:      33
Char:      1
Error:      Object required: 'Links(...)'
Code:      800A01A8
Source:       Microsoft VBScript runtime error

---------------------------
OK  
---------------------------
0
 
LVL 9

Expert Comment

by:JonMny
ID: 20000204
Did it open IE when you ran it? What URL did you use?
0
 
LVL 11

Author Comment

by:bsharath
ID: 20000257
Yes it opens the iE and for this link...
http://www.experts-exchange.com/?qipuIndex=1&openQuest=true#questionsInProgress


Here i have all my open Q's...
I got the error here.

For Yahoo it worked fine...
0
 
LVL 9

Accepted Solution

by:
JonMny earned 2000 total points
ID: 20000688
just add this

on error resume next

on the first line

Not sure what your trying to do but if your wanting to monitor questions on EE you may want to check out quickee on sourceforge.net
0
 
LVL 48

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 20003644
>>but if your wanting to monitor questions on EE you may want to check out quickee on sourceforge.net

...or even better, check out my profile :)
0
 
LVL 11

Author Comment

by:bsharath
ID: 20003692
I get this...
---------------------------
QuickEE
---------------------------
Object reference not set to an instance of an object.
---------------------------
OK  
---------------------------


After installing it asks me for the username and password after i provide i get this...

It says Logging in please wait....
0
 
LVL 48

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 20003701
bsharath,

Any bugs or problem you encounter, please post in the Bugs thread -> http:/Q_22769793.html

Wayne
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question