Jump to content

Search the Community

Showing results for tags 'parser'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 3 results

  1. hello dear freaks, try to extract some lines out of a webpage - with following technique: with the Extraction of values of attributes of elements with Simple HTML-DOM-Parser. Here is what i have gathered and learned: Try to retrieve the contents of a div from the external site withg PHP, and XPath: This is an excerpt from the page, showing the relevant code: note: i try to add all - also to add @ on the class and a at the end on my query, After that, i use saveHTML() to get it. see my test: Here the example; view-source:https://wordpress.org/plugins/participants-database/ and https://wordpress.org/plugins/participants-database/ goal: i need the following data: Version: Last updated: Active installations: Tested up: view-source:https://wordpress.org/plugins/participants-database/ <div class="entry-meta"> <div class="widget plugin-meta"> <h3 class="screen-reader-text">Meta</h3> <ul> <li>Version: <strong></strong></li> <li> Last updated: <strong><span>5 days</span> ago</strong> </li> <li>Active installations: <strong>10,000+</strong></li> <li> Requires WordPress Version:<strong>4.0</strong> </li> <li>Tested up to: <strong>4.9.4</strong></li> or here : view-source:https://wordpress.org/plugins/wp-job-manager/ </ul> <p>See additional changelog items in changelog.txt</p></div> </div><!-- .entry-content --> <div class="entry-meta"> <div class="widget plugin-meta"> <h3 class="screen-reader-text">Meta</h3> <ul> <li>Version: <strong>1.29.3</strong></li> <li> Last updated: <strong><span>2 weeks</span> ago</strong> </li> <li>Active installations: <strong>100,000+</strong></li> <li> Requires WordPress Version:<strong>4.3.1</strong> </li> <li>Tested up to: <strong>4.9.4</strong></li> Proceedings; i checked the source of the webpage. i tried to find out whether the texte is related to some kind of pattern. i have looked closely and found that all of them have class=”widget plugin-meta”. Well - This will make extracting them, a piece of cake. I tried with the code below helps to filter html elements based on values of attributes. <?php include('simple_html_dom'); $url = 'https://wordpress.org/plugins/wp-job-manager/'; $html = file_get_html($url); $text = array(); foreach($html->find('a[class="widget plugin-meta"]') as $text) { $text[] = $text->plaintext; } print_r($headlines); ?> but unfortunatly this ends up in a bad result
  2. Hi can someone help me out as i'm new to php. I have a grabber built in to my script that gets info from other sites for example. This part is from the site that my grabber gets the info from. <div class="txt-block"> <h4 class="inline">Runtime:</h4> <time itemprop="duration" datetime="PT103M">103 min</time> </div> And this is how my grabber gets this info from the site. $times = $dom->getElementsByTagName('time'); for($i=0; $i<$times->length; $i++){ $itemprop = $times->item($i)->getAttribute("itemprop"); if ($itemprop == "duration"){ if ($times->item($i)->textContent!='-'){ $res['duration'] = $times->item($i)->textContent; } } } Now what i'm stuck on is what would the code be to get the date published from the site. <span class="nobr"> <a href="/title/tt0099785/releaseinfo?ref_=tt_ov_inf " title="See all release dates"> 16 November 1990 <meta itemprop="datePublished" content="1990-11-16"> (USA) </a> </span> Would it be something like this. $meta = $dom->getElementsByTagName('meta'); for($i=0; $i<$meta->length; $i++){ $itemprop = $meta->item($i)->getAttribute("itemprop"); if ($itemprop == "datePublished"){ if ($meta->item($i)->textContent!='-'){ $res['datePublished'] = $meta->item($i)->textContent; } } } Could someone please help as i don't have a clue about writing php.
  3. I would like to get the certain information but I couldn't parser it, it come with blank information. <?php include_once('./simple_html_dom.php'); $html = file_get_html('http://www1.abs33.com/rs/index.php?result&date=05-06-2013'); foreach ($html->find('*[class1]') as $a) foreach ($a->find('ul') as $q) echo $q; ?>
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.