Questions tagged [domcrawler]

The DomCrawler is a Symfony component for PHP which eases DOM navigation for HTML and XML documents.

The DomCrawler component eases DOM navigation for HTML and XML documents and is part of the the Symfony PHP components.

The filter() function accepts the jQuery Selector Syntax and eases the selection of HTML tags and attributes.

Documentation

179 questions
0
votes
2 answers

Symfony - DomCrawler get element by custom attribute

I need filter this tag
I tried it $crawler = $crawler->filter('div[dir=3D"ltr"]'); But not work... Expected "]", but found. Any ideas?
0
votes
1 answer

Unicode characters causing 404 error in file_get_contents()

I have an app visiting URLs automatically through links. It works good as long as the URL doesn't contain Unicode. For example, I have a link: Kraków The link contains just pure ó character…
Robo Robok
  • 21,132
  • 17
  • 68
  • 126
0
votes
0 answers

Can't extract og:image with domcrawler but can with og:description

So I'm trying to fetch some open graph data with domcrawler using the php package "Goutte". Specifically, I'm trying to extract the og:image. $goutteClient = new Client(); $guzzleClient = new GuzzleClient(array( 'timeout' =>…
Felix
  • 2,532
  • 5
  • 37
  • 75
0
votes
2 answers

How to select a link by its label containing non breaking spaces using the symfony dom crawler?

I have a link:  Back to the list I try to use it in a Test. For this purpose, I select it by its…
LucileDT
  • 546
  • 1
  • 6
  • 22
0
votes
3 answers

How to select a link using its id or its label with the symfony dom crawler?

Is it possible to select a link using its id or its class with the symfony crawler? I tried: $crawler()->selectLink('#return-button')->link(); $crawler()->selectLink('.btn.return')->link(); But I have the error: InvalidArgumentException: The…
LucileDT
  • 546
  • 1
  • 6
  • 22
0
votes
1 answer

Extracting the proper value from a webpage with Goutte

I've installed Goutte in my Laravel 5.7 application, and I'm trying to scrape the values for COAL, GAS, HYDRO, and WING (TNG Column) from this page: http://ets.aeso.ca/ets_web/ip/Market/Reports/CSDReportServlet Route::get('hdtuto', function () { …
Frank Barcenas
  • 611
  • 1
  • 5
  • 18
0
votes
3 answers

Is it possible to search by regexp with Symfony Dom crawler?

The Dom Crawler Component is powerfull to parse html content, in its documentation describes basics selections (like filter('body > p')) or more complex xpath like //span[contains(@id, "article-")] Is it possible to fetch elements by regular…
Danil Pyatnitsev
  • 2,172
  • 2
  • 26
  • 39
0
votes
1 answer

Goutte - get link from a td while iterating through columns

I am trying to get a mixture of text and href from a table, the last column contains href while the others is just text. How can I get the text and appropriate href while iterating. I have html table and I want to make array from the table $html =…
Tim Chosen
  • 41
  • 8
0
votes
1 answer

Symfony domcrawler iterating through multiple forms select submit button

Using the example table html below I would like help with iterating through each table row, and clicking the display button, for each row with DomCrawler. I tried filtering using many different criteria such as below but couldn't figure it out. The…
Billy Joe
  • 49
  • 1
  • 8
0
votes
1 answer

Guzzle Client Crawler Url Not found 404

I'm url https://tiki.vn/sua-bot-meiji-noi-dia-hohoemi-milk-so-0-800g-p3678041.html I use package https://github.com/FriendsOfPHP/Goutte $client = new Client(); $guzzleClient = new GuzzleClient(array( 'verify' => false )); …
Tai Ho
  • 546
  • 4
  • 9
0
votes
0 answers

Goutte / Symfony DOM Crawler download file from form

There is a form in the remote page, which, after submitted, automatically download specific file to your computer. How could I grab that file and store it on server using Goutte or native Symfony DOM Crawler? Currently I have this code: $client…
0
votes
1 answer

PHP DomCrawler fails

I'm grabing some information using PHP, 'DomDrawler' and 'Xpath Helper' When I query some node information, there is no matched value returned. I don't know why it doesn't work. Page
Raven Xu
  • 11
  • 4
0
votes
1 answer

Need APIFY crawling data

I want to just get the details of production which i am getting via crawling. I want to go to next page and come back. How can I do it, as there are not many references available? function pageFunction(context) { // called on every page the…
0
votes
1 answer

PHP Goutte Web Scraping

I want to scrape this: Japan Sun Apple - Fuji 2 per pack This is my code: use Goutte\Client; $client = new Client(); $crawler = $client->request('GET',…
Krisnadi
  • 641
  • 1
  • 10
  • 23
0
votes
2 answers

Web Scraping with PHP Goutte

I want to get all the item name and price from this website For example, i want to search for "apple" https://redmart.com/search/apple I use Goutte for scraping the website. This is the code so far to get all item's name in the list: $client = new…
Krisnadi
  • 641
  • 1
  • 10
  • 23