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
1
vote
1 answer

DomCrawler 2nd and etc child

I'm reworking my parsers from SimpleHTMLDom on DomCrawler and on some points dcumentation(as for me) not covering all the questions which might be from newbie devs. In SHD i'm wrote just like this for access to second child: $value =…
J.Doe
  • 31
  • 7
1
vote
0 answers

how to find dynamically loading websites with java program?

I am crawling webpages with the help of jsoup..But it does not work fine for dynamic webpages..In that case i will use selenium for crawling a dynamic site..The problem is that ,how to find the difference between static webpage and dynamic webpage…
SPK
  • 11
  • 1
1
vote
0 answers

Symfony DomCrawler Client->request() wont go past login page

I'm struggling with the DomCrawler Component for Symfony, specifically the Client Request method I've been trying to hit a url within my site, "/foo/path/foo-user-1" where "foo-user-1" has been a parameter I passed through. The uri string is as…
gbenavid
  • 21
  • 5
1
vote
1 answer

Symfony Dom Crawler Missing Node, Inconsistent Behaviour

With this code: use Symfony\Component\DomCrawler\Crawler; require_once(__DIR__ . '/../vendor/autoload.php'); $html = <<<'HTML'

Hello World!

Hello Crawler!

Jimmix
  • 5,644
  • 6
  • 44
  • 71
1
vote
0 answers

Extracting class name using DomCrawler

I am trying to scrape a review score from Trustpilot. The HTML block looks like this
katie hudson
  • 2,765
  • 13
  • 50
  • 93
1
vote
1 answer

DOMCrawler truncates tags inside text()

I have a text with internal custom tags $html = '' $crawler = new Crawler($html); $text = $crawler->filter('textarea[name="main"]')->text(); print_r($text); But DOMCrawler…
DanKud
  • 221
  • 1
  • 4
1
vote
0 answers

Selecting specified DOMElement value with laravel goutte / DOMCrawler - The current node list is empty error

I have a page that renders html like this:
Latheesan
  • 23,247
  • 32
  • 107
  • 201
1
vote
1 answer

Can only get one result Dom Crawler

trying to get all the content within the h2 (to get the title of the article) in the div id=firehoselist but the following code only returns the first result. Any ideas please $crawler = new Crawler($content); …
GAV
  • 1,205
  • 2
  • 18
  • 38
1
vote
1 answer

How can I find a link by URL in my functional test?

In the Symfony testing documentation, it shows how to select a link containing specific text: $crawler->selectLink('Click here'); But the link I'm looking for won't always have the same text. It will say one of a few different things depending on…
Don't Panic
  • 41,125
  • 10
  • 61
  • 80
1
vote
2 answers

How to use symfony dom parser

I am trying to use Symfony Crawler. So I have checked this article. What I want to do is to get the 3,335.00(The second argument) For now, I try sentence like this, but it is wrong. $crawler = $crawler->filter('body > div[@class="cell_label"]'); How…
whitebear
  • 11,200
  • 24
  • 114
  • 237
1
vote
1 answer

Symfony's DomCrawler does not find a specific tag

I'm using DomCrawler to get data from a Google Play page and it works in 99% of cases, except I stumbled upon a page where it can not find a specific div. I check the HTML code and it is definitely there. My code is $autoloader = require…
John Baker
  • 425
  • 4
  • 22
1
vote
1 answer

Symfony2 - DomCrawler - fetch element's content by it's neighbour content in regex

I have this xml:
user3076049
1
vote
1 answer

Symfony DomCrawler link contains searched HTML

This is a project that I do in my free time to help reduce my time spent doing repetitive clicking in my company, so I hope it is not offending or prohibited. Page to be scraped I only want the URI of the second link, because it is the exact search…
peter.babic
  • 3,214
  • 3
  • 18
  • 31
1
vote
0 answers

Preserve content with unencoded less- and greater-than signs when using Symfony's DomCrawler

I'm crawling website, which text contains unencoded < or > sign. This breaks it's content, which then appears empty. Example $html = '
< 50%
'; $crawler = new \Symfony\Component\DomCrawler\Crawler($html); echo…
Skysplit
  • 1,875
  • 12
  • 16
Title Laravel for Noobs