Troubles with a spider class
Posted on
16th Feb 2014 07:03 pm by
admin
I am building a spider that will crawl through random whitepages (eg. anywho.com, switchboard.com, whitepages.com, etc..) and collect the information on the people found there and throw it into a database. So far I've only made this little prototype, however after trying to run it I've run into a bunch of problems....a lot of them I fixed but there are some with the expressions that I can't figure out.
Here are the errors:
QuoteWarning: preg_match_all() [function.preg-match-all]: Compilation failed: missing ) at offset 57 in /home/public_html/spider/inc/anywho.class.php on line 51
Warning: preg_match_all() [function.preg-match-all]: Delimiter must not be alphanumeric or backslash in /home/public_html/spider/inc/anywho.class.php on line 72
Warning: preg_match_all() [function.preg-match-all]: No ending delimiter '^' found in /home/public_html/spider/inc/anywho.class.php on line 73
Warning: preg_match() [function.preg-match]: No ending delimiter '^' found in /home/public_html/spider/inc/anywho.class.php on line 76
Warning: preg_replace() [function.preg-replace]: No ending delimiter '.' found in /home/public_html/spider/inc/anywho.class.php on line 92
Warning: preg_replace() [function.preg-replace]: No ending delimiter '^' found in /home/public_html/spider/inc/anywho.class.php on line 93
Warning: preg_replace() [function.preg-replace]: No ending delimiter '.' found in /home/public_html/spider/inc/anywho.class.php on line 94
Warning: preg_replace() [function.preg-replace]: No ending delimiter '^' found in /home/public_html/spider/inc/anywho.class.php on line 95
Warning: preg_replace() [function.preg-replace]: No ending delimiter '*' found in /home/public_html/spider/inc/anywho.class.php on line 96
Along with these it isn't printing out the info like it is suppose to on line 56 of anywho.class.php
As to the fact that these are two files and a little bigger then the normal "snippet" I posted them both in a pin board. The links are below.
Spider Class: http://www.coderprofile.com/networks/code-pin-board/258/spiderclassphp
Anywho Class: http://www.coderprofile.com/networks/code-pin-board/257/anywhospiderclassphp
And here is the source of the form page:
Code: <?php
require("spider.class.php");
require("anywho.class.php");
$spider=new spider("Lorem Ipsum","Lorem Ipsum","Lorem Ipsum","localhost",15);
$any=new anywho;
if(isset($_POST['submit'])){
$state=$_POST['state'];
$last=$_POST['last'];
$first = (isset($_POST['first'])) ? $_POST['first'] : null;
$street = (isset($_POST['street'])) ? $_POST['street'] : null;
$zip = (isset($_POST['zip'])) ? $_POST['zip'] : null;
$any->initialize($last,$state,$first,$street,$city,$zip);
$any->any_crawl($any->url,0,1);
}
?>
<form action="index.php" method="post">
Last Name: <input type="text" name="last">*
First Name: <input type="text" name="first">
Street: <input type="text" name="street">
Zip: <input type="text" name="zip">
State:
<select name="state" style="height:17px; font-size:9px;">
<option value="">Select a State</option>
<option value="AL" selected="selected" >Alabama</option>
...........................
...........................
<option value="WY">Wyoming</option>
</select>*
<input type="submit" value="Crawl" name="submit">
</form>
I'm really sorry about the messy code and poor documentation.
Also I really appreciate any and all replies!
No comments posted yet
Your Answer:
Login to answer
125
7
Other forums
article site help remaining text
Hi all hope you will be fine
I am creating a article site in this site i want to put some text on
session_destroy();
new to php
I have a simple login and am trying to write a logout.
I set a $_SESSION var to 1 i
How to copy a part of a vector in a raw memory
Hi,
How can I copy a part of a vector into a memory:
1
2
3
4
5
Saving data from a form into a file
Hey everybody,
Sorry, I am really new to PHP coding and such but a project kind of got thrust
Quick Question about echo value
Hey guys, I'm trying to get something to show differently in one of my scripts. I'm trying to make
Getting Resource id #11 while trying to connect..
So i tried using "DEFINE" for the first time and im using the variables i defined to conne
IDOC error
Hi,
When i send IDOC from ECC system to MII there is no problem ECC side, i says message sent succe
losing variables between php brackets
Hi
have got this code:
Code: $id=mysql_result($result,0,"itemid");
$title=mys
How to add functionality to a simple php calender?
Hello everyone,
I have just finished creating a simple php calander. Can someone point
PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi