Solved

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

Posted on 2013-01-11
7
306 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
  • 4
  • 2
7 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
Comment Utility
0
 
LVL 11

Author Comment

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

Accepted Solution

by:
krishnakrkc earned 500 total points
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 11

Author Comment

by:bsharath
Comment Utility
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
Comment Utility
this might be a performance issue. Rather than draging the formula go cell by cell.

Kris
0
 
LVL 11

Author Comment

by:bsharath
Comment Utility
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
Comment Utility
Anyway i can add 2 things to check within it?

Also any way to speed up?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now