Welcome Guest, Not a member yet? Register   Sign In
Web Scraping in CI4
#1

I'm doing a CodeIgniter4 Project utilizing web scraper, paritcularly Goutte. Is this the right approach, are there any web scrapers more suitable for CI4? Where would I store the scraping scripts, what folder or file?
Reply
#2

Not sure but this may set you on the right path.

freecodecamp - Web Scraping with PHP – How to Crawl Web Pages Using Open Source Tools
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(This post was last modified: 06-19-2024, 04:43 PM by minsk832.)

You can easily use and integrate PHP libraries like

https://github.com/voku/simple_html_dom
https://github.com/spekulatius/PHPScraper

in CodeIgniter. Simply create a library.

PHP Code:
namespace App\Libraries;

use 
simplehtmldom\HtmlWeb;

class 
HtmlDomParser
{
    public function parseFromUrl($url)
    {
        $htmlWeb = new HtmlWeb();
        $html $htmlWeb->load($url);

        return $html;
    }

Reply




Theme © iAndrew 2016 - Forum software by © MyBB