• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Pull a web page link from website

mgesh2002

Member
Hi Everyone,


I need a help on the following query.


Query:

I have website names in column D2, and I need a macro to open this link and search for the page (either Events or Presentations) and copy the corresponding link and paste into my excel at Column C2.


For Example:


In D2, I have this link: http://www.samsung.com/us/aboutsamsung/ir/newsMain.do


and in C2, I need this link to be pasted,

http://www.samsung.com/us/aboutsamsung/ir/ireventpresentations/ircalendar/IR_IRCalendar.html


Hope, I made this clear and would appreciate all your valuable suggestions.
 
Hi mgesh2002,


So technically you want to open a webpage.

Read the HTML code,

Search for any *.pdf or *.ppt,

copy its File Location.. And download all the files or save the URL of all the file..

in Excel...


So, Why don't you go for http://www.internetdownloadmanager.com/support/idm-grabber/idm_grabber.html


Which is cost of $24.95..

Regards,

Deb
 
Thanks for your response, Debraj.


Yes, I want to open a webpage and read the html code.


But, I don't want to search for *.pdf or *.ppt, instead, I need to search for the link with title Events or Presentations and select the URL for the title and paste it back to my workbook.


So, here I just need a URL for the link (Events/Presentations).


Thanks Again.
 
Hi mgesh2002,


Please find the attached file.. Click on open Webpage.. and wait for sometime..

Provide the Keyword to search..


https://dl.dropbox.com/u/78831150/Excel/Pull%20a%20web%20page%20link%20from%20website%28mgesh2002%29.xls

[pre]
Code:
Sub OpenHTMLpage_SearchIt()
Dim Cell As Range, Keyword$, N%, SearchAgain As VbMsgBoxResult
'put your own URL below, an example is given
Dim OpenFile As String
ThisWorkbook.Sheets(1).Cells.Clear
OpenFile = InputBox("Enter the WebPage Address", "WebPage Search", "http://www.samsung.com/us/aboutsamsung/ir/newsMain.do")
Application.Workbooks.Open OpenFile
Columns(1).ColumnWidth = 85
StartSearch:
N = 0
Keyword = InputBox("Enter the word or phrase you are looking for", "Keyword Is ?", "Event")
ThisWorkbook.Sheets(1).Range("A1") = "Keyword"
ThisWorkbook.Sheets(1).Range("B1") = "Found URL"
ThisWorkbook.Sheets(1).Range("A1:b1").Font.Bold = True
ThisWorkbook.Sheets(1).Range("A2") = Keyword
If Keyword = Empty Then GoTo StartSearch
For Each Cell In ActiveSheet.UsedRange
On Error Resume Next
If Cell Like "*" & Keyword & "*" Then
ThisWorkbook.Sheets(1).Range("B" & N + 2) = Cell.Hyperlinks(1).Address
N = N + 1
End If
On Error GoTo 0
Next Cell
If N = 0 Then MsgBox "Sorry, no " & Keyword & "'s found", , "not Found"
ActiveWorkbook.Close False
End Sub
[/pre]

Please let us know if it working fine.

Regards,

Deb
 
Back
Top