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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:26:52+00:00 2026-06-03T13:26:52+00:00

find() here is a function of the simple_html_dom library, that should return dom node

  • 0

find() here is a function of the simple_html_dom library, that should return dom node elements when given an id/class.

$urlFetched->find("#".$id) always fails to find and return something when the $id is “fk-list-MP3-Players-/-IPods”. I am guessing the problem is with the forward slash and simple_html_dom, because there is no problem with the other ids and urls(snipped).
What do I do? my program is almost complete and dependent on simple html dom.

Thanks

The code:

$urlAndIds = array(
   array("http://www.flipkart.com/audio"  , array('fk-list-Home-Audio', htmlentities("fk-list-MP3-Players-/-IPods"), 'fk-list-Accessories'),array('ALL','AllBrands')) );

foreach($urlAndIds as $uAI) {
    $url = file_get_contents($uAI[0]) ;
    $urlFetched = str_get_html($url) ;

    if ($url == false){
         echo 'page '.$uAI[0] . " not found"  ."<br>" ."<br>";
    }   else {
        foreach ($uAI[1] as $id) {
            $idFound = $urlFetched->find("#".$id) ;
            if(!$idFound) {

                echo 'In page '.$uAI[0].' -id not found- '.$id  ."<br>";
            }
        }
    }


}
  • 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-03T13:26:54+00:00Added an answer on June 3, 2026 at 1:26 pm

    The slash is being interpreted as part of the XPath expression, so it’s looking for a child element named -IPods. There is no XPath “quote” type function either. I’m not sure whether adding a backslash would work, but it may be easier for you to just use a normal attribute selector with id: [@id='fk-list-MP3-Players-/-IPods']

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

Sidebar

Related Questions

I have a quick question here. I know that the cakePHP find('first') function returns
I have got this function that returns a constant..Here is my class and function:
Here's the situation. function scrollLog(line) { // Assume Firefox // alert(weird); frames['log'].find(line); }; Here's
Here's my jQuery: var docname = $('#doc').val(); function parseXml(xml) { $(xml).find(rsp).each(function() { alert(success); });
Here is something that I find disturbing. I created a small form, and I'm
I have a simple function in my library that checks the validity of an
I am using the backbone-boilerplate, which you can find here . I was wondering
The only instructions I could find are here: http://eigenclass.org/hiki/fast-widefinder and on the old jocaml
I hope I will find a help here. I have a quite complex MVC
I am using jQuery Accordion here and find some strange behavior when opening a

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.