whitetogrey
Newbie
- Jul 4, 2012
- 5
- 0
Hi there,
sorry for my bad english, i'm a native german SEO
I want to scrape the search volumes from the Keyword Tool of Google and in my opinion i'm on a good way.
I found this lines in another board:
============
1) Login to Google. I use this URL '/accounts/ServiceLoginAuth', but there are a few different ones.
2) Request this url "/um/StartNewLogin?sourceid=awo&subid=ww-en-et-gaia" and follow all the redirects, there are 6 (this is setting cookies need for Adwords).
3) When the last redirect complete and the HTML data is returned, extract the values for __u= and __c=. I use regex but any way will do.
============
Step 1 is no problem at all, curl tells me a ReturnCode 200 and the cookie is set. In my opinion the script should be logged in.
While requesting the second URL I'll get also a 200, but the script takes me back to Login Page, so i cannot extract u= and c=.
My next thought was to use the URL checkSession, which says that cookies are not used. In my curl i use cookiejar as well as cookiefile
Do anyone have a suggestion where my mistake is? Thanks for your help.
BTW: as this is my first post, i can't write the whole url. before / there is https google
sorry for my bad english, i'm a native german SEO
I want to scrape the search volumes from the Keyword Tool of Google and in my opinion i'm on a good way.
I found this lines in another board:
============
1) Login to Google. I use this URL '/accounts/ServiceLoginAuth', but there are a few different ones.
2) Request this url "/um/StartNewLogin?sourceid=awo&subid=ww-en-et-gaia" and follow all the redirects, there are 6 (this is setting cookies need for Adwords).
3) When the last redirect complete and the HTML data is returned, extract the values for __u= and __c=. I use regex but any way will do.
============
Step 1 is no problem at all, curl tells me a ReturnCode 200 and the cookie is set. In my opinion the script should be logged in.
While requesting the second URL I'll get also a 200, but the script takes me back to Login Page, so i cannot extract u= and c=.
My next thought was to use the URL checkSession, which says that cookies are not used. In my curl i use cookiejar as well as cookiefile
Code:
$url2 = "/um/StartNewLogin?sourceid=awo&subid=ww-en-et-gaia";
curl_setopt($ch, CURLOPT_URL, $url2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POST, false);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
Do anyone have a suggestion where my mistake is? Thanks for your help.
BTW: as this is my first post, i can't write the whole url. before / there is https google