Go Back   CodingForums.com > :: Client side development > General web building

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-07-2012, 05:01 PM   PM User | #1
Peeyush
Regular Coder

 
Join Date: Apr 2012
Posts: 104
Thanks: 27
Thanked 2 Times in 2 Posts
Peeyush is an unknown quantity at this point
script which can read source code of a page?

for example i have 1000 webpages, and thier usl of the form - example.com/example.php?page=1, example.com/example.php?page=2, ....... , example.com/example.php?page=1000, now if there is written a word - hello on any two out of thousand pages, supposing i have the method of finding source code of all of the pages, i can put it all through loop and find what two pages have hello written in them using regexp. But problem is how can i make my program read page's source code?
__________________
Everything is simpler with jQuery!
Peeyush is offline   Reply With Quote
Old 06-07-2012, 05:35 PM   PM User | #2
Lerura
Regular Coder

 
Lerura's Avatar
 
Join Date: Aug 2005
Location: Denmark
Posts: 869
Thanks: 0
Thanked 112 Times in 111 Posts
Lerura will become famous soon enough
you could load your example.php's in an iframe.
<iframe id="Tester" onload="Test();">

Code:
var Currentpage=1;
var MaxPage=1000;
var HitPages=[];
function Test(){
TestFrame=document.getElementById('Tester');
Content=TestFrame.contentDocument.body.innerHTML;
isMatch=Content.match(/hello/);
if (isMatch){
HitPages.push(CurrentPage);
}
CurrentPage++;
if (CurrentPage <= MaxPage){
TestFrame.src="example.com/example.php?page="+CurrentPage;
}else{
  // code for handling the result (HitPages)
}
}
window.onload=function(){document.getElementById('Tester').src="example.com/example.php?page="+CurrentPage;}
Lerura is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:13 PM.


Advertisement
Log in to turn off these ads.