{"id":26442727,"url":"https://github.com/ahmard/queliwrap","last_synced_at":"2025-03-18T10:29:57.120Z","repository":{"id":38041560,"uuid":"261061188","full_name":"Ahmard/queliwrap","owner":"Ahmard","description":"QueryList PHP web scrapper wrapper","archived":false,"fork":false,"pushed_at":"2023-04-19T20:41:43.000Z","size":96,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-21T13:46:39.449Z","etag":null,"topics":["php","querylist","webcrawler","webscraper"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ahmard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-04T02:11:28.000Z","updated_at":"2025-01-22T09:47:02.000Z","dependencies_parsed_at":"2023-01-30T04:00:22.664Z","dependency_job_id":null,"html_url":"https://github.com/Ahmard/queliwrap","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahmard%2Fqueliwrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahmard%2Fqueliwrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahmard%2Fqueliwrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahmard%2Fqueliwrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ahmard","download_url":"https://codeload.github.com/Ahmard/queliwrap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244201487,"owners_count":20415087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","querylist","webcrawler","webscraper"],"created_at":"2025-03-18T10:29:56.612Z","updated_at":"2025-03-18T10:29:57.111Z","avatar_url":"https://github.com/Ahmard.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Queliwrap.\n==============================================\n\nQueliwrap is a wrapper that provides easy helper functions around PHP popular web scrapper,\n[QueryList](https://github.com/jae-jae/QueryList) and\n[Guzwrap](https://github.com/ahmard/guzwrap).\n\n**Notice:** **_Queliwrap\\Wrapper\\Queliwrap::exec()_** method has been replaced with **_execute()_**. exec() now returns\n**psr-7** compliant object while execute() returns **QueryList** object.\n\n## Installation\n\nMake sure you have [Composer](http://getcomposer.org) installed.\n\n```bash\ncomposer require ahmard/queliwrap\n```\n\nAfter installation is done, require Composer's autoloader in your code:\n\n```php\nrequire 'vendor/autoload.php';\n```\n\n## Usage\n**Queliwrap relies on [Guzwrap](https://github.com/ahmard/guzwrap), you might want to dig a little deeper in\nto it**.\n\n```php\nuse Queliwrap\\Client;\n\nClient::get('https://google.com')-\u003eexecute()\n    -\u003efind('ul')-\u003eeq(0)\n    -\u003efind('li');\n```\n\nHandle errors\n```php\nuse Queliwrap\\Client;\n\ntry {\n    $text = Client::get('https://google.com')-\u003eexecute()\n        -\u003efind('ul')-\u003eeq(0)\n        -\u003efind('li')\n        -\u003etext();\n        \n    echo $text;\n}catch (Throwable $exception){\n    echo $exception-\u003egetMessage();\n}\n```\n\n### Submit Form\n\n```php\nuse Guzwrap\\Wrapper\\Form;\nuse Queliwrap\\Client;\n\nClient::post(function(Form $form){\n    $form-\u003eaction('http://localhost:8080/rand/guzwrap.php');\n    $form-\u003efield('name', 'Jane Doe');\n    $form-\u003efile('image', 'C:\\1.jpg');\n});\n```\n\n### Cookies\n\nThanks to [Guzwrap](https://github.com/Ahmard/guzwrap) cookies can be preserved across multiple requests\n\n```php\nuse Guzwrap\\Wrapper\\Form;\nuse Queliwrap\\Client;\n\n//Login\nClient::create()\n    -\u003ereferer('http://localhost:8000')\n    -\u003ewithSharedCookie()\n    -\u003eform(function (Form $form){\n        $form-\u003eaction('http://localhost:8000/login');\n        $form-\u003emethod('POST');\n        $form-\u003einput('email', 'queliwrap@example.com');\n        $form-\u003einput('password', 1234);\n        $form-\u003einput('remember_me', 1);\n    })-\u003eexec();\n\n//View user profile\n$queryList = Client::create()\n    -\u003eget('http://localhost:8000/users/view')\n    -\u003equery(['id' =\u003e 2])\n    -\u003ewithSharedCookie()\n    -\u003eexecute();\n\n//Find user info\n$firstName = $queryList-\u003efind('.profile')\n    -\u003efind('list-group-item')\n    -\u003eeq(0)\n    -\u003etext();\n\necho \"First name: {$firstName}\";\n```\n\n## Documentations\n\n- [QueryList](https://github.com/jae-jae/QueryList)\n- [Guzwrap](http://github.com/ahmard/guzwrap)\n- [Guzzle](http://guzzlephp.org/)\n\n## Licence\nQueliwrap is **MIT** licenced.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmard%2Fqueliwrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmard%2Fqueliwrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmard%2Fqueliwrap/lists"}