[GoogleSearch] Correct parsing uri of search result (#1601)
This commit is contained in:
parent
78facbcb83
commit
a33088ca99
1 changed files with 1 additions and 7 deletions
|
@ -35,14 +35,8 @@ class GoogleSearchBridge extends BridgeAbstract {
|
||||||
|
|
||||||
$item = array();
|
$item = array();
|
||||||
|
|
||||||
// Extract direct URL from google href (eg. /url?q=...)
|
|
||||||
$t = $element->find('a[href]', 0)->href;
|
$t = $element->find('a[href]', 0)->href;
|
||||||
$item['uri'] = '' . $t;
|
$item['uri'] = htmlspecialchars_decode($t);
|
||||||
parse_str(parse_url($t, PHP_URL_QUERY), $parameters);
|
|
||||||
if(isset($parameters['q'])) {
|
|
||||||
$item['uri'] = $parameters['q'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$item['title'] = $element->find('h3', 0)->plaintext;
|
$item['title'] = $element->find('h3', 0)->plaintext;
|
||||||
$item['content'] = $element->find('span[class=st]', 0)->plaintext;
|
$item['content'] = $element->find('span[class=st]', 0)->plaintext;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue