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 6877175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:34:07+00:00 2026-05-27T04:34:07+00:00

If there are other classes written to do this, a link would be awesome.

  • 0

If there are other classes written to do this, a link would be awesome. If not, how can I do it with PHPCrawl?

Is it possible to store specific information from a crawled site based upon a set of rules specific to the site? Ex., [div.wantThis, img#defaultPicture] is the array returned for site A and only [div.shortTextContent] is the array returned for site B?

In PHPCrawl, how can I get this information out of the $page_data array?

Needs

Must be able to target only certain elements.

Able to read the data storage rule from a variable (which could be an array specifying the element(s) to target).

  • 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-05-27T04:34:07+00:00Added an answer on May 27, 2026 at 4:34 am

    What you are asking is how to parse specific content from site A and some other specific content from site B using PHPCrawl.

    For site specific parsing style following if-else approach can be followed:

    for url in urls:
        content = crawl(url)
        if(url of type 1?):
            extract_style1(content)
        else-if(url of type 2?):
            extract_style2(content)
        else:
            extract_styledefault(content)
    

    For specific content extracting following algo can be used:

    Note: There are spectrum of parsing techniques avaliable, I am implmeneting HTML DOM Parsing here..

    // Create DOM from your PHP Crawl Data Source
    $html = $page_data[source]
    
    // Find all images 
    foreach($html->find('img') as $element) 
           echo $element->src . '<br>';
    
    // Find all links 
    foreach($html->find('a') as $element) 
           echo $element->href . '<br>';
    

    Reference:

    HTML DOM
    PHPCrawl Example

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

Sidebar

Related Questions

In some sample codes there are methods and classes declared WITHIN other methods and/or
I know you can look at the row.count or tables.count, but are there other
There are other posts that say you can create a control in windows forms
I've written a series of classes to interperet data from a serial port. This
Are there any classes/functions written in php publicly available that will take a timestamp,
Can anyone help me with this? I have not been able to find anything
Are there other possibilities besides IIS for hosting web sites and web services based
Is there other technique like RVO (return value optimization) or NRVO (named return value
Anything out there other than llvm ? libjit doesn't seem very active.. I need
Just want to know if there other optional wrapper framework available that generate client

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.