Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Oct 14, 2023
1 parent d3aa27c commit ee1d6c6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .phpunit.cache/test-results
@@ -1 +1 @@
{"version":1,"defects":{"GoogleSerpTest::testPuphpeteerMobile":8,"GoogleSerpTest::testCurlMobile":8,"GoogleSerpTest::testExtractionPositionZero":8,"GoogleSerpTest::testExtractMaps":8,"GlobalTest::testTextDataExtractor":7,"GoogleSerpTest::testExtractMapsB":8,"GoogleTrendsTest::testTrendsPuppet":8,"GoogleSuggesterTest::testGoogleSuggester":8},"times":{"PiedWeb\\Crawler\\Test\\CrawlerTest::testIt":5.97,"PiedWeb\\Crawler\\Test\\CrawlerTest::testCommand":0.324,"PiedWeb\\Crawler\\Test\\CrawlerTest::testWitchCachId":0.637,"PiedWeb\\Curl\\Test\\HelperTest::testSchemeFromProxy":0,"PiedWeb\\Curl\\Test\\HelperTest::testCheckContentType":0,"PiedWeb\\Curl\\Test\\HelperTest::testCheckStatusCode":0,"PiedWeb\\Curl\\Test\\RequestTest::testDownloadIfHtml":0.51,"PiedWeb\\Curl\\Test\\RequestTest::testNotDownload":0.259,"PiedWeb\\Curl\\Test\\RequestTest::testEffectiveUrl":21.565,"PiedWeb\\Curl\\Test\\RequestTest::testCurlError":0.055,"PiedWeb\\Curl\\Test\\RequestTest::test404":0.242,"PiedWeb\\Curl\\Test\\RequestTest::testAllMethods":0.315,"PiedWeb\\Curl\\Test\\RequestTest::testMultipleCheckInHeaders":0.125,"PiedWeb\\Curl\\Test\\RequestTest::testProxy":1.002,"PiedWeb\\Curl\\Test\\RequestTest::testAbortIfTooBig":15.226,"PiedWeb\\Curl\\Test\\RequestTest::testDownloadOnlyFirstBytes":0.237,"PiedWeb\\Curl\\Test\\RequestTest::testResponseFromCache":0.001,"PiedWeb\\Curl\\Test\\StaticWrapperTest::testStaticGet":0.068,"GlobalTest::testEncoding":0.001,"GlobalTest::testCanonical":0.737,"GlobalTest::testTextDataExtractor":0.431,"GlobalTest::testHrefLangExtractor":0.682,"GoogleSerpTest::testPuphpeteerMobile":8.528,"GoogleSerpTest::testCurlMobile":0.714,"GoogleSerpTest::testExtractionPositionZero":0.663,"GoogleSerpTest::testExtractMaps":2.168,"GoogleSuggesterTest::testGoogleSuggester":6.272,"GoogleTrendsTest::testTrendsCurl":0.002,"GoogleTrendsTest::testTrendsPuppet":0.002,"PiedWeb\\TextAnalyzer\\Test\\AnalyzerTest::testMultiAnalyzer":0.009,"PiedWeb\\TextAnalyzer\\Test\\AnalyzerTest::testTextAnalyzer":0.003,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testSimpleSentences":0,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testRemoveExtremityStopWords":0,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testRemoveExtremityStopWords2":0,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testRemoveStopWords":0,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testStripTags":0.001,"GoogleSerpTest::testRelatedSearches":0.54,"GoogleSerpTest::testExtractMapsB":0.704}}
{"version":1,"defects":{"GoogleSerpTest::testPuphpeteerMobile":8,"GoogleSerpTest::testCurlMobile":8,"GoogleSerpTest::testExtractionPositionZero":8,"GoogleSerpTest::testExtractMaps":8,"GlobalTest::testTextDataExtractor":7,"GoogleSerpTest::testExtractMapsB":8,"GoogleTrendsTest::testTrendsPuppet":7,"GoogleSuggesterTest::testGoogleSuggester":8,"GoogleTrendsTest::testTrendsCurl":8},"times":{"PiedWeb\\Crawler\\Test\\CrawlerTest::testIt":1.298,"PiedWeb\\Crawler\\Test\\CrawlerTest::testCommand":0.322,"PiedWeb\\Crawler\\Test\\CrawlerTest::testWitchCachId":0.583,"PiedWeb\\Curl\\Test\\HelperTest::testSchemeFromProxy":0,"PiedWeb\\Curl\\Test\\HelperTest::testCheckContentType":0,"PiedWeb\\Curl\\Test\\HelperTest::testCheckStatusCode":0,"PiedWeb\\Curl\\Test\\RequestTest::testDownloadIfHtml":1.317,"PiedWeb\\Curl\\Test\\RequestTest::testNotDownload":0.201,"PiedWeb\\Curl\\Test\\RequestTest::testEffectiveUrl":20.552,"PiedWeb\\Curl\\Test\\RequestTest::testCurlError":0.046,"PiedWeb\\Curl\\Test\\RequestTest::test404":0.292,"PiedWeb\\Curl\\Test\\RequestTest::testAllMethods":0.232,"PiedWeb\\Curl\\Test\\RequestTest::testMultipleCheckInHeaders":0.121,"PiedWeb\\Curl\\Test\\RequestTest::testProxy":1.002,"PiedWeb\\Curl\\Test\\RequestTest::testAbortIfTooBig":0.238,"PiedWeb\\Curl\\Test\\RequestTest::testDownloadOnlyFirstBytes":0.205,"PiedWeb\\Curl\\Test\\RequestTest::testResponseFromCache":0.001,"PiedWeb\\Curl\\Test\\StaticWrapperTest::testStaticGet":0.055,"GlobalTest::testEncoding":0.003,"GlobalTest::testCanonical":0.773,"GlobalTest::testTextDataExtractor":0.396,"GlobalTest::testHrefLangExtractor":0.639,"GoogleSerpTest::testPuphpeteerMobile":11.422,"GoogleSerpTest::testCurlMobile":2.154,"GoogleSerpTest::testExtractionPositionZero":1.525,"GoogleSerpTest::testExtractMaps":4.003,"GoogleSuggesterTest::testGoogleSuggester":1.376,"GoogleTrendsTest::testTrendsCurl":4.543,"GoogleTrendsTest::testTrendsPuppet":24.73,"PiedWeb\\TextAnalyzer\\Test\\AnalyzerTest::testMultiAnalyzer":0.009,"PiedWeb\\TextAnalyzer\\Test\\AnalyzerTest::testTextAnalyzer":0.003,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testSimpleSentences":0,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testRemoveExtremityStopWords":0,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testRemoveExtremityStopWords2":0,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testRemoveStopWords":0,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testStripTags":0.001,"GoogleSerpTest::testRelatedSearches":1.084,"GoogleSerpTest::testExtractMapsB":0.704}}
4 changes: 2 additions & 2 deletions packages/google/src/Extractor/SERPExtractor.php
Expand Up @@ -24,7 +24,7 @@ class SERPExtractor
/**
* @var string[]
*/
final public const RELATED = ['//span[text()="Recherches associées"]/ancestor::*[position() < 5]//a/div/div/span'];
final public const RELATED = ['//span[text()="Recherches associées"]/ancestor::*[position() < 5]//a'];

/**
* @var string[]
Expand Down Expand Up @@ -310,7 +310,7 @@ public function getRelatedSearches(): array
$nodes = $this->domCrawler->filterXPath($xpath);
foreach ($nodes as $node) {
if ('' !== $node->textContent) {
$kw[] = $node->textContent;
$kw[] = trim($node->textContent);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/google/tests/GoogleTrendsTest.php
Expand Up @@ -35,6 +35,7 @@ public function testTrendsPuppet(): void

$extractor = $manager->getExtractor();
$this->assertGreaterThan(10, $extractor->getInterestAverage());
dump($extractor->getRelatedQueriesSimplified());
$this->assertArrayHasKey('randonnée vtt', $extractor->getRelatedQueriesSimplified());
}
}

0 comments on commit ee1d6c6

Please sign in to comment.