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
0 answers

Symfony Dom-crawler select nth-child of element

I am currently using symfony DOM-crawler for website scraping. I just wanna know how to select specific elements with the same class or name. I wanna use it also in tds. here is the syntax I'm using currently: $nameCrawler =…
jn_lance
  • 1
  • 6
0
votes
0 answers

Scrape from OG tags DOMCrawler - PHP

I'm having trouble when scraping from this website. This code used to work but now it scrapes the wrong image. The purpose of this code is to scrape product image. But now it scrapes the logo of the website. here's a sample product link from that…
Devin Y
  • 137
  • 2
  • 13
0
votes
3 answers

Get img src that contains a certain word from xpath

I used headless mode to extracta webpage and here's the related inner HTML part of the output.
\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t
Devin Y
  • 137
  • 2
  • 13
0
votes
1 answer

Using XPath to get text of the immediate children

I have this portion of HTML that I need to parse:

names: John, Mark
occupation: actor

I'm using Symfony Dom Crawler to parse several pages. I need the text contents…
Robo Robok
  • 21,132
  • 17
  • 68
  • 126
0
votes
0 answers

A more idiomatic way to get

I have a $brick which is an instance of Crawler and this is how $brick->html() starts:
testplain 1
I am fishing out the div containing testplain 1 with: $content = $brick ->children()->first() …
chx
  • 11,270
  • 7
  • 55
  • 129
0
votes
0 answers

How should pass a DomCrawler object as input parameter correctly? "Undefined property: Crawler::$extract "

When I pass the DomCralwer Object to my helper function: function extractText(Crawler $crawler, $selector) { $result = $crawler->filter($selector)->extract['_text']; return $result ? $result[0] : false; } it can not recognize the extract…
Peyman Kheiri
  • 397
  • 6
  • 22
0
votes
1 answer

Goutte crawler get style

I am using Goutte crawler. So, for the few hours, I was trying to get a style attribute of a div in a search page with specific query, and this style have a Background-img. So first I made a GET request to the url by $crawler =…
Evara
  • 84
  • 2
  • 11
0
votes
1 answer

Puppeteer element is console.log'able but return undefined in puppeteer

I'm trying to crawl a webpage that has a h3 tag under an a tag. I'm getting the a tag just fine, but when trying to get the innerText of h3 I'm getting an undefined value. This is what I'm trying to crawl: const puppeteer =…
BenNov
  • 1,086
  • 2
  • 10
  • 18
0
votes
1 answer

Symfony GuzzleHttp Crawler cannot find all elements on the page

I am trying to get data from the amazon product page. But the search for the price always result in The current node list is empty. . The other elements like title are present in the result. $jar = new CookieJar(); $url =…
serj
  • 193
  • 1
  • 3
  • 19
0
votes
0 answers

I get no data when download images

so iam trying to download images by this code i successfully download the images but they without any data and corrupted like the images have 0 bytes function get_chapter_images(){ include('simple_html_dom.php'); $url =…
0
votes
0 answers

DomCrawler after a certain tag take

I want to get the label after br can be hlmt tag after br tag , or there may be no labels filter(div>br+*) is it a right choice ?
0
votes
2 answers

DomCrawler does not bring all the links?

not all links on the target site gives only why 5 links? div.td.cm4.takimlar the structures are the same
0
votes
2 answers

DomCrawler filterXpath for emails

In my project I am trying to use filterXPath for emails. So I get an E-Mail via IMAP and put the mail body into my DomCrawler. $crawler = new Crawler(); $crawler->addHtmlContent($mail->textHtml); //mail html content utf8 Now to my issue. I only…
Syllz
  • 290
  • 6
  • 22
0
votes
1 answer

Locating TD position by it's TH, domCrawler

I am trying to scrape table's td tag, but first I need to check th. For example let say table structure is like below. color red price 23.267$ …
tate
  • 49
  • 7
0
votes
1 answer

DomCrawler filter html tags

so trying to get the text content of html tags using Symfony DomCrawler This is a strong text This is a strong text

this is a header 2 text

So goal is to get for example…
MAV
  • 29
  • 8