Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kurorido committed Sep 18, 2019
2 parents 6d6b0f8 + 9f88914 commit 945ff37
Show file tree
Hide file tree
Showing 5 changed files with 393 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/GoogleUrlTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
trait GoogleUrlTrait
{

public abstract function getParamValue($param, $defaultValue = null);
public abstract function buildUrl();
public abstract function getParamRawValue($param, $defaultValue = null);
public abstract function getHost();
public abstract function getPath();
public abstract function getScheme();
public abstract function getParams();
public abstract function getHash();
abstract public function getParamValue($param, $defaultValue = null);
abstract public function buildUrl();
abstract public function getParamRawValue($param, $defaultValue = null);
abstract public function getHost();
abstract public function getPath();
abstract public function getScheme();
abstract public function getParams();
abstract public function getHash();

/**
* Get the number of the page, the pages are 1 indexed
Expand Down
2 changes: 1 addition & 1 deletion src/Parser/Evaluated/NaturalParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ protected function generateRules()
*/
protected function getParsableItems(GoogleDom $googleDom)
{
return $googleDom->xpathQuery("//div[@id = 'rso']/*");
return $googleDom->xpathQuery("//*[@id = 'rso']/*");
}
}
5 changes: 5 additions & 0 deletions src/Parser/Evaluated/Rule/Natural/AnswerBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ protected function parseNode(GoogleDom $dom, \DOMElement $node)
// TODO ERROR
return;
}

if ($h3Tag = $dom->cssQuery('h3', $aTag)->item(0)) {
return $h3Tag->getNodeValue();
}

return $aTag->nodeValue;
},
'url' => function () use ($dom, $node) {
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
url: https://www.google.co.uk/search?q=cheap+video+editing+software+mac+nantes
file: test/resources/pages-evaluated/2019/07/cheap+video+editing+software+mac.html

test-methods:
javascriptIsEvaluated: true
isMobile: false

results:

- types:
- ANSWER_BOX

data:
title: Best video editing software for Mac - MacPaw


- types:
- CLASSICAL

data:
title: "Best video editing software for Mac - MacPaw"
url: https://macpaw.com/how-to/best-video-editing-software
destination: https://macpaw.com/how-to/best-video-editing-software
description: Jul 12, 2018 - Best free video editing software for Mac. iMovie. Apple's consumer focused video editing tool used to only be free if you bought a new Mac. DaVinci Resolve. If iMovie isn't for you, give DaVinci Resolve a try. Lightworks. OpenShot. Video Editor MovieMator. Final Cut Pro X. Adobe Premiere Pro CC. Adobe Premiere Elements ...


# TODO video group not parsed


- types:
- CLASSICAL

data:
title: "Best free or inexpensive Mac video editors: iMovie, Lightworks, and ..."
url: https://www.macworld.co.uk/feature/mac-software/mac-video-editors-3697211/
destination: https://www.macworld.co.uk › Features › Mac Software Features


- types:
- CLASSICAL

data:
title: Top 10 Best Free Video Editing Software for Mac Users [2019 Update]


- types:
- CLASSICAL


- types:
- CLASSICAL


- types:
- CLASSICAL


- types:
- CLASSICAL


- types:
- PEOPLE_ALSO_ASK


- types:
- CLASSICAL


- types:
- CLASSICAL


related-searches:
- title: imovie video editing software mac
url: https://www.google.co.uk/search?gl=US&q=imovie+video+editing+software+mac&sa=X&ved=2ahUKEwjuuPWt3L7jAhVC-6wKHXVJAQ0Q1QIoAHoECAoQAQ
- title: video editing software for mac free download
- title: avidemux video editing software mac
- title: video editing software for old mac
- title: best video editing software for mac 2019
- title: editing videos on mac
- title: free video editing software mac no watermark
- title: final cut pro

0 comments on commit 945ff37

Please sign in to comment.