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

Get forms with DomCrawler in Laravel 5.2

I'm working with Laravel 5.2 Commands and trying to get a form with Symfony component DomCrawler. So, with the help of DomCrawler docs and api, I have this code: use Illuminate\Console\Command; use GuzzleHttp\Client as GuzzleClient; use…
franco
  • 112
  • 1
  • 13
0
votes
1 answer

Symfony \ Component \ CssSelector \ Exception \ SyntaxErrorException cssselector to xpath in laravel

I have following html select element, select element's attribute name containing square bracket and need to filter using domcrawler but unfortunately, CssSelectorConvertor() cannot convert cssselector to xpath because of square bracket in the name…
0
votes
1 answer

Test: Crawler DateTimeType: date_widet and time_widget

I have a DateTimeWidget rendered by 2 fields: public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('datetime', DateTimeType::class, [ 'date_widget' => 'single_text', …
goto
  • 7,908
  • 10
  • 48
  • 58
0
votes
1 answer

Get content inside nested div class using Goute PHP

Sorry for bad english. So i want to scrap some content from the website, but the div classes are nested and confusing me. Basically the structure is :
Pengarang …
0
votes
1 answer

Symfony DomCrawler can't get attribute

For this div:
0
votes
1 answer

How to use wild card for domCrawler symfony?

Is it possible to use wild card to not select some UL LI element like following?
  • <-- this one
  • <-- this one
Best regards,
Leo S
  • 375
  • 5
  • 12
0
votes
1 answer

DomCrawler select only paragraphs

I want to extract just the paragraphs in each .pertanyaan class, before the .listjawaban class using DomCrawler/Goutte Symfony component Is there any way to do this? I'm coming with $crawler->filter('.pertanyaan p')->eq($i)->html() but it just gives…
Terry Djony
  • 1,975
  • 4
  • 23
  • 41
0
votes
0 answers

Add html content to a tag in PHP using DOMCrawler

The goal is to make some modifications to an HTML document. I load an HTML document in the following way: $html5 = new \HTML5(); $dom = $html5->loadHTML($content); $crawler = new Crawler($dom); I managed to delete nodes I don't need,…
makeze
  • 55
  • 1
  • 1
  • 10
0
votes
2 answers

Parsing with Goutte - how to target an element after one containing a text string

I am using https://github.com/FriendsOfPHP/Goutte to parse and extract data and I am doing well... But now I stumbled upon a slightly unfriendly spot: Website:
Peter
  • 2,634
  • 7
  • 32
  • 46
0
votes
1 answer

Guzzle Async process response as it comes in

I've been working on a script that makes close to a thousand async requests using getAsync and Promise\Settle. Each page requested it then parsed using Symphony crawler filter method (Also slow but a separate issue.) My code looks something like…
Ben Lewis Watson
  • 168
  • 2
  • 11
0
votes
1 answer

Symfony DomCrawler: Unable to fetch tag by Id

I am scraping this page. I am accessing following HTML to fetch Section details:

Volume one:
Volatil3
  • 14,253
  • 38
  • 134
  • 263

0
votes
1 answer

Going backwards with Symfony DomCrawler

I'm using Symfony DomCrawler to parse my HTML. I'm reading articles on my website like this: $domCrawler->filter('.post')->each(function (DomCrawler $post) { // ... }); How can I walk through them backwards? I'd like to start from the post that…
Robo Robok
  • 21,132
  • 17
  • 68
  • 126
0
votes
1 answer

symfony crawler not work from this site

I want to get data from this site but symfony crawler not worked for http://www.varzesh3.com/livescore/feed and the string does not gain
mohsen
  • 4,698
  • 1
  • 33
  • 54
0
votes
0 answers

Crawl / Scrape the DOM of a single webpage then re-render it?

I would like to crawl / scrape the Dom of a given URL and re-render it on another URL. This is for Growth Hacking tool purpose An example would be, I want to rerender the page http://x.com/x.html. I browse…
0
votes
0 answers

Goutte Symfony Domcrawler open js modal!?

i am using the Goutte (Symfony Dom)crawler which is not able to fire js and open a modal. Its a silly question but are there any extensions for Goutte. Can I get access to a modal. What would you suggest? I would be thankful for any answer.