Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8068875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:49:41+00:00 2026-06-05T12:49:41+00:00

I have a crawler which scrapes a website for information and then inserts the

  • 0

I have a crawler which scrapes a website for information and then inserts the values into a database, it seems to insert the first 4000~ rows fine but then suddenly stops inserting values to the mysql database even though the crawler is still scraping the website

Database table

CREATE TABLE IF NOT EXISTS `catalog` (
  `id` varchar(100) NOT NULL DEFAULT '',
  `title` varchar(100) DEFAULT NULL,
  `value` double DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

PHP insert function

function addToCatalog($id, $title, $value){
   $q = "INSERT INTO catalog VALUES('$id', '$title', $value)";
   return mysql_query($q, $this->connection);           
}

php scrape function

function scrape($pageNumber){
   $page = file_get_html('http://example.com/p='.$pageNumber);  

   if($page){
      $id = array();
      $title = array();
      $value = array();

      //id
      if($page->find('.productid')){
         foreach ($page->find('.productid') as $p) {
            $id[] = $p->innertext;
         }          
      }

      //title
      if($page->find('.title')){
         foreach($page->find('.title') as $p){
            $title[] = $p->innertext;
         }
      }

      //value
      if($page->find('.value')){
         foreach($page->find('.value') as $p){
            $value[] = $p->innertext;
         }
      }

      for($i=0; $i<sizeof($id); $i++){
          $add = $database->addToCatalog($id[$i], $title[$i], $value[$i]);
          echo $id[$i]." ".$title[$i]." ".$value[$i]."<br>";
      }
   }
}

for($i=0; $i<31300; $i++){
    scrape($i);
}

Any help with this problem would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:49:43+00:00Added an answer on June 5, 2026 at 12:49 pm

    If the execution of the process stops after about 30 seconds, your problem is probably the max_execution_time setting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a very basic crawler which scrapes product information from websites to
I have a very basic web crawler. The database table which stores the links
I have a website which has two domains added. Both domains point to the
I have a crawler which crawls a site for a specific value, this value
I have a class which acts as a simple crawler and I want to
I have a personal website, which I have made (to the best of my
I'm creating a php website in which I have a document.php that basically takes
I have set a crawler up in Wordpress which grabs stocks data and writes
I have a web crawler that looks for specific information I want and returns
I have a crawler Java application which is supposed to connect to some HTTP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.