Jump to content
UBot Underground

[HOW TO] Download CSV from Adwords Keyword Planner


Recommended Posts

I saw a lot of people asking the question from title, so I've decided to share this code:

click($element offset(<(innertext="Download" AND class="goog-button-base-content")>, 0), "Left Click", "No")
wait for browser event("Everything Loaded", "")
wait for element(<id="gwt-debug-adwords-editor-csv-radio-input">, "", "Appear")
click(<id="gwt-debug-adwords-editor-csv-radio-input">, "Left Click", "No")
wait for browser event("Everything Loaded", "")
click(<id="gwt-debug-download-button-content">, "Left Click", "No")
wait for browser event("Everything Loaded", "")
wait for element(<id="gwt-debug-download-link">, "", "Appear")
set(#URL, $scrape attribute(<id="gwt-debug-download-link">, "fullhref"), "Global")
in shared browser {
    navigate(#URL, "Don\'t Wait")
    wait for browser event("Everything Loaded", 5)
    save downloaded file("C:\\test.csv")
}

Here is the video of script in action: http://screencast.com/t/a1jb4GVFN8o

 

However, you need to manually log in, start the search and add keywords to output file if needed, then you are ready to run the script above.

 

I've coded this script today and it worked when I tested it; I remember that old Adwords Keyword Tool didn't always work, and bot had to re-start download if the file wasn't saved, so you may experience similar problems with new Planner tool.

 

However, I hope you find this useful.

 

EDIT: I've updated the code and it should make downloading faster.

  • Like 2
Link to post
Share on other sites

i didn't even think to try the in shared browser command, I'll have to test it out and see how this works. Anyway, the http post plugin worked good also.

 

Thanks for the share,

 

Edit: Not intended to hijack your thread or anything, just adding to it. Anyway, this works flawlessly and works every time to download the csv. Requires the http post plugin though.The variables are set to local so just add the define to your scrip and set the parameters.

download keywords.ubot

Link to post
Share on other sites

i didn't even think to try the in shared browser command, I'll have to test it out and see how this works. Anyway, the http post plugin worked good also.

 

Thanks for the share,

 

Edit: Not intended to hijack your thread or anything, just adding to it. Anyway, this works flawlessly and works every time to download the csv. Requires the http post plugin though.The variables are set to local so just add the define to your script.

I'm using shared (new) browser only to keep main browser page active after download (download command closes the browser and UBot is unable to interact with it anymore). Else I think the trick is that you need to navigate to CSV file instead of trying to download (I got a strange server error when I tried to download directly).

 

The script I published also worked in all the test that I have ran, I'm just mentioning that I had some problems with old Keyword Tool, (it might be due to the fact that I was downloading hundreds of CSV per day).

 

Np at all, thanks for sharing that version.

Link to post
Share on other sites
  • 3 months later...

It appears that the kw planner interface has changed somewhat.  The current code does not work.

 

Would you be kind to take a look and post a revision?

 

Thanks in advance!

The first part of code actually strill works, but I spent a few minutes on 2nd part and I couldn't get it working. The problem is that for some reason google doesn't recognize download request as we were logged in, that's why UBot downloads login page instead of csv.

 

If you really need it you can try further; here is the code I came up with:

click($element offset(<class=w"aw-toolbelt-downloadButton *">, 1), "Left Click", "No")
wait for element(<id="gwt-debug-download-button-content">, "", "Appear")
click(<id="gwt-debug-download-button-content">, "Left Click", "No")
wait for browser event("DOM Ready", "")
wait for element(<id="gwt-debug-retrieve-download-content">, "", "Appear")
wait for browser event("DOM Ready", "")
allow popups("Yes")
click(<id="gwt-debug-retrieve-download-content">, "Left Click", "No")
wait for browser event("Everything Loaded", "")
wait for element(<(tagname="iframe" AND src=w"*.csv")>, "", "Appear")
set(#URL, $scrape attribute(<(tagname="iframe" AND src=w"*.csv")>, "src"), "Global")
in shared browser {
    download file(#URL, "c:\\test.csv")
}

Btw, it's really strange, since if I manually navigate to scraped #URL I get a csv file. Because of that I think there might be a way around, since UBot should still have Google cookies for login.

Link to post
Share on other sites
  • 2 months later...

i didn't even think to try the in shared browser command, I'll have to test it out and see how this works. Anyway, the http post plugin worked good also.

 

Thanks for the share,

 

Edit: Not intended to hijack your thread or anything, just adding to it. Anyway, this works flawlessly and works every time to download the csv. Requires the http post plugin though.The variables are set to local so just add the define to your scrip and set the parameters.

 

what to fill in URL to Download http://screencast.com/t/oRG8pO57OU4 ?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...