Solved

Check all URl's if the page source has this content

Posted on 2013-01-11
7
313 Views
Last Modified: 2013-01-18
Hi,

I want help with a script that read all URL's in the file and check the page source and gives yes/No

This below line should be searched

<span style="font-size:12px;"><span style="font-family:arial,helvetica,sans-serif;">


Sample
http://tinyurl.com/bzl8lpb

Excel macro or a vbs would be helpful

regards
0
Comment
Question by:bsharath
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 38766331
0
 
LVL 11

Author Comment

by:bsharath
ID: 38766343
Thanks
I am not a programmer
Can you please help with the code?
0
 
LVL 18

Accepted Solution

by:
krishnakrkc earned 500 total points
ID: 38766453
Hi,

In a standard module

Dim objXH           As Object

Public Function kBool(URL As String) As Boolean


Dim strURL          As String
Dim strBody         As String

Const strKey        As String = "<span style=""font-size:12px;""><span style=""font-family:arial,helvetica,sans-serif;"">"

If objXH Is Nothing Then Set objXH = CreateObject("msxml2.xmlhttp")

With objXH
    .Open "get", URL, False
    .send
    strBody = .responseText
End With

kBool = CBool(InStr(1, strBody, strKey, 1))

End Function

Open in new window


and try

=kBool(A2)

where A2 hlds the URL

Kris
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Author Comment

by:bsharath
ID: 38766471
Thanks
seems like it works

Have a query

does it check

<span style=""font-size:12px;""><span style=""font-family:arial,helvetica,sans-serif;"">

if available in page then TRUE?

As page source a few that it does not have this exact line is also shown as TRUE
0
 
LVL 18

Expert Comment

by:krishnakrkc
ID: 38766595
this might be a performance issue. Rather than draging the formula go cell by cell.

Kris
0
 
LVL 11

Author Comment

by:bsharath
ID: 38766613
When the formulas are reading the screen freezes so it only gets to editable mode when the formulas have retrieved
0
 
LVL 11

Author Comment

by:bsharath
ID: 38771421
Anyway i can add 2 things to check within it?

Also any way to speed up?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

763 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