Jump to content

Search the Community

Showing results for tags 'parser'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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 (Dreamweaver, Zend, 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  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>1.7.7.6</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
×
×
  • 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.