search-engine-google icon indicating copy to clipboard operation
search-engine-google copied to clipboard

v0.4.0 Not returning Ad results

Open LunarDevelopment opened this issue 6 years ago • 5 comments

Hello,

I'm doing requests for pretty standard keywords holiday homes cornwall which does have adwords.

Then parsing natural results fine, but if I parse foreach ($gRank->adwordsResults as $i => $position) { I get 0 results.

Is this a Dom issue ?

using google.co.uk

LunarDevelopment avatar May 29 '18 13:05 LunarDevelopment

Hi @LunarDevelopment

I'm not sure it's related to v0.4 because there were no updates that would broke this part of the code.

Can you confirm it was working just before you upgrade?

PS: did you make sure to use the correct method as seen here https://serp-spider.github.io/documentation/search-engine/google/parse-page/#adwords-sections

In your example you are using ->adwordsResults instead of ->getAdwordsResults()

gsouf avatar May 29 '18 19:05 gsouf

I don't believe it was working pre upgrade.. I'm scraping thousands of terms a day and the last adword record I got was a single result on 2018-05-29 and prior to that 4 results on 2018-05-23.

So it seems to be working 0.0001% of the time..?

$gRank->adwordsResults is the output of $this->adwordsResults = $this->response->getAdwordsResults();

I've tried hundreds of terms while testing and I always get the below from getAdwordsResults()on v0.4.0, I've not had an adword result yet.

object(Serps\Core\Serp\CompositeResultSet)#69 (1) {
  ["resultSets":protected]=>
  array(2) {
    [0]=>
    object(Serps\SearchEngine\Google\AdwordsSectionResultSet)#66 (3) {
      ["location":protected]=>
      string(16) "adws_section_top"
      ["startingAt":protected]=>
      int(0)
      ["items":protected]=>
      array(0) {
      }
    }
    [1]=>
    object(Serps\SearchEngine\Google\AdwordsSectionResultSet)#63 (3) {
      ["location":protected]=>
      string(19) "adws_section_bottom"
      ["startingAt":protected]=>
      int(0)
      ["items":protected]=>
      array(0) {
      }
    }
  }
}

To be honest the adwords results are just being collected as a byproduct which is why they've gone unnoticed but it would be nice to know it's working well / contribute in a small way back to this fantastic library.

LunarDevelopment avatar May 30 '18 08:05 LunarDevelopment

Here's an output example:

dom.html.zip

LunarDevelopment avatar May 30 '18 08:05 LunarDevelopment

Same issue here !

dlepaux avatar Jul 04 '18 07:07 dlepaux

This resolved it's self for me.

Closing because of inactivity..

LunarDevelopment avatar Jul 12 '18 08:07 LunarDevelopment