Solved

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

Posted on 2013-01-11
7
312 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
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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

828 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