Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Extract Google Autocomplete keywords with Python
{
"cells": [
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"seo berlin job\n",
"seo berlin preise\n",
"seo berlin\n",
"seo berlin - webdesigner4seo.com\n",
"seo berlin agentur\n",
"seo profi berlin\n",
"seo manager berlin\n",
"seo nerd berlin\n",
"seo kurs berlin\n",
"seo beratung berlin\n",
"seo berlin agentur\n",
"seo agency berlin\n",
"seo artist berlin\n",
"seo agentur berlin\n",
"seo ausbildung berlin\n",
"seo akademie berlin\n",
"seo marketing agentur berlin\n",
"beste seo agentur berlin\n",
"seo marketing agentur berlin spam\n",
"seo agentur berlin digitaleffects.de\n",
"seo beratung berlin\n",
"seo course berlin\n",
"seo consultant berlin\n",
"seo consulting berlin\n",
"seo coaching berlin\n",
"seo berlin - webdesigner4seo.com\n",
"seo site check berlin\n",
"seo profi berlin @ dskom gmbh\n",
"seo agentur berlin digitaleffects.de\n",
"seo experte berlin\n",
"seo freelancer berlin\n",
"seo fortbildung berlin\n",
"seo firmen berlin\n",
"fairplay seo berlin\n",
"myoung-le seo fu berlin\n",
"seo gehalt berlin\n",
"seo manager berlin gehalt\n",
"seo-nerd gmbh berlin\n",
"sem seo gmbh berlin\n",
"seo profi berlin @ dskom gmbh\n",
"seo hilfe berlin\n",
"seo in berlin\n",
"seo iq berlin\n",
"seo jobs in berlin\n",
"seo agency in berlin\n",
"seo service in berlin\n",
"seo agentur in berlin\n",
"seo manager ihk berlin\n",
"seo company in berlin\n",
"seo lernen berlin\n",
"link seo berlin\n",
"local seo berlin\n",
"seo manager berlin\n",
"seo marketing berlin\n",
"seo meetup berlin\n",
"seo manager berlin gehalt\n",
"seo messe berlin\n",
"seo malerin berlin\n",
"junior seo manager berlin\n",
"senior seo manager berlin\n",
"seo nerd berlin\n",
"seo nest berlin\n",
"seo optimierung berlin\n",
"seo berlin preise\n",
"seo profi berlin\n",
"seo profi berlin @ dskom gmbh\n",
"seo profis berlin\n",
"praktikum seo berlin\n",
"seo seminar berlin\n",
"seo support berlin\n",
"seo schulung berlin\n",
"seo stammtisch berlin\n",
"seo spezialist berlin\n",
"seo service berlin\n",
"seo suchmaschinenoptimierung berlin\n",
"seo manager salary berlin\n",
"seo marketing agentur berlin spam\n",
"senior seo berlin\n",
"seo texter berlin\n",
"seo trainee berlin\n",
"seo training berlin\n",
"seo teilzeit berlin\n",
"seo vhs berlin\n",
"seo kurs berlin vhs\n",
"seo zimmermann berlin\n",
"seo berlin - webdesigner4seo.com\n",
"seo workshop berlin\n",
"seo weiterbildung berlin\n",
"seo werkstudent berlin\n",
"seo webdesign berlin\n",
"seo germany\n",
"seo agency germany\n",
"seo company germany\n",
"seo salary germany\n",
"seo services germany\n",
"seo companies in germany\n",
"seo specialist salary germany\n",
"seo jobs germany\n",
"seo manager salary germany\n",
"seo service in germany\n",
"seo agency germany\n",
"seo deutschland agentur für internetmarketing\n",
"seo agentur deutschland\n",
"seo company germany\n",
"best seo company germany\n",
"seo experten deutschland\n",
"seo freelancer deutschland\n",
"seo firma deutschland\n",
"seo forum deutschland\n",
"seo gehalt deutschland\n",
"seo in germany\n",
"seo in deutschland\n",
"seo company in germany\n",
"seo agency in germany\n",
"seo salary in germany\n",
"seo companies in germany\n",
"seo services in germany\n",
"seo jobs in germany\n",
"seo service in germany\n",
"seo internship in germany\n",
"seo markt deutschland\n",
"seo marketing deutschland\n",
"seo optimierung deutschland\n",
"seo spezialisten deutschland\n",
"seo salary germany\n",
"seo services germany\n",
"seo specialist salary germany\n",
"seo manager salary germany\n",
"seo service in germany\n",
"seo tools deutschland\n"
]
}
],
"source": [
"import requests\n",
"import string\n",
"import xml.etree.ElementTree as ET\n",
"\n",
"\n",
"list_a = [\"seo berlin\", \"seo germany\"]\n",
"list_b = [\" \", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"z\",\n",
" \"ü\", \"ä\", \"ö\", \"y\", \"w\", \"x\"] \n",
"list_c = [f\"{i} {j}\" for i in list_a for j in list_b]\n",
" \n",
"for x in list_c:\n",
" apiurl = \"http://suggestqueries.google.com/complete/search?output=toolbar&hl=de&q=\" + x\n",
" r = requests.get(apiurl)\n",
" tree = ET.fromstring(r.text)\n",
" \n",
" \n",
" for child in tree.iter('suggestion'):\n",
" print(child.attrib['data'])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment