Slide 1

Slide 1 text

Web scraping with Symfony Panther

Slide 2

Slide 2 text

Raphael de Almeida

Slide 3

Slide 3 text

https://t.me/phprio

Slide 4

Slide 4 text

Take pics of conference and publish Make a new friend Give feedback for speakers

Slide 5

Slide 5 text

In the ideal world all applications share data via API

Slide 6

Slide 6 text

Data returned is structured

Slide 7

Slide 7 text

Not only in JSON

Slide 8

Slide 8 text

Richardson Maturity Model

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

But it isn’t the real world

Slide 11

Slide 11 text

We need to extract structured data from no-strutured data sites

Slide 12

Slide 12 text

Web Scraping

Slide 13

Slide 13 text

web indexing data minning auto-typing forms price comparison change detection

Slide 14

Slide 14 text

This is easy, cURL resolves I'm Hacky

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

How to simulate a user reading HTML, handling forms and cookies?

Slide 17

Slide 17 text

Guzzle DomCrawler

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

The Web evolves and with it we have the SPA

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

https://www.linkedin.com/jobs/

Slide 22

Slide 22 text

source-code

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

WebDriver W3C protocol Google Chrome Headless

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

Show me the code

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

https://github.com/raphaeldealmeida/pokemon-memory-game-player

Slide 30

Slide 30 text

Tips

Slide 31

Slide 31 text

Use Page Object

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

Create logs for all important actions

Slide 34

Slide 34 text

Monolog

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

Monitor the execution of your service

Slide 37

Slide 37 text

Monit

Slide 38

Slide 38 text

handle timeout cases

Slide 39

Slide 39 text

References ● https://github.com/symfony/panther ● https://martinfowler.com/bliki/PageObject.html ● https://symfony.com/doc/current/components/dom_crawler.html ● http://docs.guzzlephp.org/en/stable/ ● http://wttr.in/sao%20paulo ● https://developers.google.com/web/updates/2017/04/headless-chrome ● https://vue-pokemon-memory-game.vinicius73.dev/ ● https://mmonit.com/monit/ ● https://github.com/Seldaek/monolog ● https://pt.wikipedia.org/wiki/Willis_Carrier

Slide 40

Slide 40 text

Support http://bit.ly/2Ita3d9

Slide 41

Slide 41 text

Give me a feedback https://joind.in/talk/e74d7

Slide 42

Slide 42 text

THANK YOU @raph_almeida https://joind.in/talk/78c98