Solved

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

Posted on 2013-01-11
7
314 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
SendBlaster Pro 4 - Bulk Email Sending Software

SendBlaster 4 Pro - Best Bulk Emailing Sending Software
Automatic Subscribe / Unsubscribe Processing
Great for Newsletters & Mass Mailings
Optional HTML & Text Composition
Integration with Google Features
Built in Spam Score Checking
Free Professional Templates - Feature Packed!

 
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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Suggested Solutions

Outlook Free & Paid Tools
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

751 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