{"id":409715,"date":"2024-06-29T20:57:33","date_gmt":"2024-06-29T20:57:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=409715"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=409715","title":{"rendered":"<span>\u041f\u0430\u0440\u0441\u0438\u043d\u0433 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 Google Scholar \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Python<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>?<strong>\u041a\u0440\u0430\u0442\u043a\u043e \u043e \u0441\u0443\u0442\u0438<\/strong>: \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 2017-2021 \u0433\u043e\u0434\u043e\u0432 \u0441 Google Scholar \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044e. \u0421\u043b\u0435\u0434\u043e\u043c \u0438\u0445 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432 CSV \u0438 SQLite \u0411\u0414 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Python \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0432\u0435\u0431-\u0441\u043a\u0440\u0435\u0439\u043f\u0438\u043d\u0433\u0430 \u043e\u0442 SerpApi.<\/p>\n<p>?<strong>\u0427\u0442\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f<\/strong>: \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0446\u0438\u043a\u043b\u043e\u0432, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439. \u0410 \u0442\u0430\u043a \u0436\u0435 <code>serpapi<\/code>, <code>urllib<\/code>, <code>pandas<\/code>, <code>sqlite3<\/code> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<p>\u23f1\ufe0f<strong>\u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0430\u0439\u043c\u0435\u0442<\/strong>: ~20-60 \u043c\u0438\u043d\u0443\u0442 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e.<\/p>\n<hr\/>\n<ul>\n<li>\n<p><a href=\"#what_will_be_scraped\" rel=\"noopener noreferrer nofollow\">\u0427\u0442\u043e \u043f\u0430\u0440\u0441\u0438\u043c<\/a> <\/p>\n<ul>\n<li>\n<p><a href=\"#prerequisites\" rel=\"noopener noreferrer nofollow\">\u0427\u0442\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f<\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#process\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e\u0446\u0435\u0441\u0441<\/a> <\/p>\n<ul>\n<li>\n<p><a href=\"#organic_results\" rel=\"noopener noreferrer nofollow\">\u041e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#cite_results\" rel=\"noopener noreferrer nofollow\">\u0426\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#save_csv\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 CSV<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#save_sqlite\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 SQLite<\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#full_code\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u0446\u0435\u043b\u0438\u043a\u043e\u043c &#8212; \u043f\u0430\u0440\u0441\u0438\u043d\u0433<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#saving_code\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u0446\u0435\u043b\u0438\u043a\u043e\u043c &#8212; \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#links\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#outro\" rel=\"noopener noreferrer nofollow\">\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435<\/a><\/p>\n<\/li>\n<\/ul>\n<h3>\u0427\u0442\u043e \u043f\u0430\u0440\u0441\u0438\u043c<\/h3>\n<p>\u0418\u0437 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c19\/ed2\/5b0\/c19ed25b0b51971cfe0ddc1204110a66.png\" width=\"4096\" height=\"1124\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c19\/ed2\/5b0\/c19ed25b0b51971cfe0ddc1204110a66.png\"\/><figcaption><\/figcaption><\/figure>\n<p>?\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u041d\u0430 Google Scholar \u0435\u0441\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u0438\u043c\u0438\u0442 \u0432 100 \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 <code>About xxx.xxx results<\/code> \u044d\u0442\u043e \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c. \u0422\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 \u0413\u0443\u0433\u043b \u043f\u043e\u0438\u0441\u043a\u043e\u043c.<\/p>\n<p>\u0418\u0437 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5a5\/06c\/0f6\/5a506c0f6c215cde4f7716cc7c1165eb.png\" width=\"2242\" height=\"1564\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5a5\/06c\/0f6\/5a506c0f6c215cde4f7716cc7c1165eb.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0427\u0442\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f<\/h3>\n<p><strong>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0438\u0440\u0443\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435<\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u043d\u0435\u0435, \u0432\u0437\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u043d\u0430 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0439 \u044d\u0442\u043e\u043c\u0443 \u0431\u043b\u043e\u0433 \u043f\u043e\u0441\u0442 \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 &#8212; <a href=\"https:\/\/serpapi.com\/blog\/python-virtual-environments-using-virtualenv-and-poetry\/\" rel=\"noopener noreferrer nofollow\">Python virtual environments tutorial using Virtualenv and Poetry<\/a>.<\/p>\n<p>\u0412\u043a\u0440\u0430\u0442\u0446\u0435, \u044d\u0442\u043e \u0448\u0442\u0443\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Python \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0447\u0442\u043e \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Python.<\/p>\n<p>?\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u0433\u0438\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435\u043c.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a:<\/p>\n<pre><code>pip install google-search-results pip install pandas<\/code><\/pre>\n<hr\/>\n<h3>\u041f\u0440\u043e\u0446\u0435\u0441\u0441<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/342\/44e\/e43\/34244ee43ad2efeaac03399bbade32f7.png\" width=\"3000\" height=\"1688\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/342\/44e\/e43\/34244ee43ad2efeaac03399bbade32f7.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>\u0437\u0430\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u043a\u043e\u0434 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 <a href=\"#full_code\" rel=\"noopener noreferrer nofollow\">\u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0446\u0435\u043b\u0438\u043a\u043e\u043c<\/a>,<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/dimitryzub\/py-google-scholar-organic-cite-to-csv-sqlite\" rel=\"noopener noreferrer nofollow\">\u0437\u0430\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u043a\u043e\u0434 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0438\u0437 GitHub \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a>,<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/replit.com\/@serpapi\/Scrape-historic-Google-Scholar-Organic-and-Citation-results#main.py\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u0432 online IDE<\/a>.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/324\/0be\/2ef\/3240be2ef2392f260dadf32eae9cc4bd.png\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/324\/0be\/2ef\/3240be2ef2392f260dadf32eae9cc4bd.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u041e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h3>\n<pre><code class=\"python\">import os from serpapi import GoogleSearch from urllib.parse import urlsplit, parse_qsl   def organic_results():     print(\"extracting organic results..\")      params = {         \"api_key\": os.getenv(\"API_KEY\"), # \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 SerpApi          \"engine\": \"google_scholar\",         \"q\": \"minecraft redstone system structure characteristics strength\",  # \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441         \"hl\": \"en\",        # \u044f\u0437\u044b\u043a         \"as_ylo\": \"2017\",  # \u0441 2017         \"as_yhi\": \"2021\",  # \u0434\u043e 2021         \"start\": \"0\"       # \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430     }      search = GoogleSearch(params)      organic_results_data = []      loop_is_true = True      while loop_is_true:         results = search.get_dict()          print(f\"Currently extracting page \u2116{results['serpapi_pagination']['current']}..\")          for result in results[\"organic_results\"]:             position = result[\"position\"]             title = result[\"title\"]             publication_info_summary = result[\"publication_info\"][\"summary\"]             result_id = result[\"result_id\"]             link = result.get(\"link\")             result_type = result.get(\"type\")             snippet = result.get(\"snippet\")                try:               file_title = result[\"resources\"][0][\"title\"]             except: file_title = None                try:               file_link = result[\"resources\"][0][\"link\"]             except: file_link = None                try:               file_format = result[\"resources\"][0][\"file_format\"]             except: file_format = None                try:               cited_by_count = int(result[\"inline_links\"][\"cited_by\"][\"total\"])             except: cited_by_count = None                cited_by_id = result.get(\"inline_links\", {}).get(\"cited_by\", {}).get(\"cites_id\", {})             cited_by_link = result.get(\"inline_links\", {}).get(\"cited_by\", {}).get(\"link\", {})                try:               total_versions = int(result[\"inline_links\"][\"versions\"][\"total\"])             except: total_versions = None                all_versions_link = result.get(\"inline_links\", {}).get(\"versions\", {}).get(\"link\", {})             all_versions_id = result.get(\"inline_links\", {}).get(\"versions\", {}).get(\"cluster_id\", {})                organic_results_data.append({               \"page_number\": results[\"serpapi_pagination\"][\"current\"],               \"position\": position + 1,               \"result_type\": result_type,               \"title\": title,               \"link\": link,               \"result_id\": result_id,               \"publication_info_summary\": publication_info_summary,               \"snippet\": snippet,               \"cited_by_count\": cited_by_count,               \"cited_by_link\": cited_by_link,               \"cited_by_id\": cited_by_id,               \"total_versions\": total_versions,               \"all_versions_link\": all_versions_link,               \"all_versions_id\": all_versions_id,               \"file_format\": file_format,               \"file_title\": file_title,               \"file_link\": file_link,             })              if \"next\" in results[\"serpapi_pagination\"]:                 search.params_dict.update(dict(parse_qsl(urlsplit(results[\"serpapi_pagination\"][\"next\"]).query)))             else:                 loop_is_true = False      return organic_results_data<\/code><\/pre>\n<h4>\u041e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044e<\/h4>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c <code>os<\/code>, <code>serpapi<\/code>, <code>urllib<\/code> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<pre><code class=\"python\">import os from serpapi import GoogleSearch from urllib.parse import urlsplit, parse_qsl<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 <code>GoogleSearch()<\/code> \u0433\u0434\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0435 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u0435 SerpApi:<\/p>\n<pre><code class=\"python\">params = {   \"api_key\": os.getenv(\"API_KEY\"), # \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 SerpApi   \"engine\": \"google_scholar\",   \"q\": \"minecraft redstone system structure characteristics strength\",  # \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441   \"hl\": \"en\",        # \u044f\u0437\u044b\u043a   \"as_ylo\": \"2017\",  # \u0441 2017   \"as_yhi\": \"2021\",  # \u0434\u043e 2021   \"start\": \"0\"       # \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 }  search = GoogleSearch(params) # \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u0443\u0442<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a <code>list()<\/code> \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432 CSV \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b<code>cite_results()<\/code> \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\">organic_results_data = []<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c <code>while<\/code> \u0446\u0438\u043a\u043b \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e \u0432\u0441\u0435\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446:<\/p>\n<pre><code class=\"python\">loop_is_true = True  while loop_is_true:     results = search.get_dict()          # \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u0443\u0442\u0430\u0447\u043a\u0438..          if \"next\" in results[\"serpapi_pagination\"]:         search.params_dict.update(dict(parse_qsl(urlsplit(results[\"serpapi_pagination\"][\"next\"]).query)))     else:         loop_is_true = False <\/code><\/pre>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e <code>\"next\"<\/code> \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 &#8212; <code>while<\/code> \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 <code>loop_is_true<\/code> \u043d\u0430 <code>False<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e <code>\"next\"<\/code> \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, <code>search.params_dict.update<\/code> \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0441\u0442 \u0435\u0451 \u043a <code>GoogleSearch(params)<\/code> \u0434\u043b\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0430\u0440\u0441\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 <code>for<\/code> \u0446\u0438\u043a\u043b\u0435:<\/p>\n<pre><code class=\"python\">for result in results[\"organic_results\"]:     position = result[\"position\"]     title = result[\"title\"]     publication_info_summary = result[\"publication_info\"][\"summary\"]     result_id = result[\"result_id\"]     link = result.get(\"link\")     result_type = result.get(\"type\")     snippet = result.get(\"snippet\")        try:       file_title = result[\"resources\"][0][\"title\"]     except: file_title = None        try:       file_link = result[\"resources\"][0][\"link\"]     except: file_link = None        try:       file_format = result[\"resources\"][0][\"file_format\"]     except: file_format = None        try:       cited_by_count = int(result[\"inline_links\"][\"cited_by\"][\"total\"])     except: cited_by_count = None        cited_by_id = result.get(\"inline_links\", {}).get(\"cited_by\", {}).get(\"cites_id\", {})     cited_by_link = result.get(\"inline_links\", {}).get(\"cited_by\", {}).get(\"link\", {})        try:       total_versions = int(result[\"inline_links\"][\"versions\"][\"total\"])     except: total_versions = None        all_versions_link = result.get(\"inline_links\", {}).get(\"versions\", {}).get(\"link\", {})     all_versions_id = result.get(\"inline_links\", {}).get(\"versions\", {}).get(\"cluster_id\", {}) <\/code><\/pre>\n<ul>\n<li>\n<p><code>try\/except<\/code> \u0431\u043b\u043e\u043a\u0438 \u0431\u044b\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 <code>None<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0438\u0437 Google \u0431\u044d\u043a\u0435\u043d\u0434\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0432 \u043e\u0434\u0438\u043d <code>try<\/code> \u0431\u043b\u043e\u043a, \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b, \u0438\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0435\u0441\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0430 \u0438\u043b\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0435\u0441\u0442\u044c \u0432 \u0432\u044b\u0434\u0430\u0447\u0435, \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d\u043e \u0432\u0435\u0440\u043d\u0451\u0442 <code>None<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0434\u0435\u0441\u044c \u043c\u043d\u043e\u0433\u043e <code>try\/except<\/code> \u0431\u043b\u043e\u043a\u043e\u0432.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 <code>list()<\/code> \u0441\u043f\u0438\u0441\u043e\u043a:<\/p>\n<pre><code class=\"python\">organic_results_data = []  # \u0442\u0443\u0442 \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u0438 while \u0446\u0438\u043a\u043b...   organic_results_data.append({     \"page_number\": results[\"serpapi_pagination\"][\"current\"],     \"position\": position + 1,     \"result_type\": result_type,     \"title\": title,     \"link\": link,     \"result_id\": result_id,     \"publication_info_summary\": publication_info_summary,     \"snippet\": snippet,     \"cited_by_count\": cited_by_count,     \"cited_by_link\": cited_by_link,     \"cited_by_id\": cited_by_id,     \"total_versions\": total_versions,     \"all_versions_link\": all_versions_link,     \"all_versions_id\": all_versions_id,     \"file_format\": file_format,     \"file_title\": file_title,     \"file_link\": file_link, })<\/code><\/pre>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 <code>list()<\/code> \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0437\u0436\u0435 \u043f\u0440\u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0435 \u0426\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">return organic_results_data<\/code><\/pre>\n<hr\/>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6a5\/ec1\/cf1\/6a5ec1cf1685cad4ca9c64b1a0547ba2.png\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6a5\/ec1\/cf1\/6a5ec1cf1685cad4ca9c64b1a0547ba2.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0426\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0438 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c <code>result_id<\/code> \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c <code>result_ids<\/code>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u041e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\"># \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a result_ids  result_ids = [\"FDc6HiktlqEJ\"...\"FDc6Hikt21J\"] for citation in result_ids:     params = {         \"api_key\": \"API_KEY\",             # \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 SerpApi         \"engine\": \"google_scholar_cite\",  # \u0434\u0432\u0438\u0436\u043e\u043a \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432         \"q\": citation                     # FDc6HiktlqEJ ... FDc6Hikt21J     }     search = GoogleSearch(params)     results = search.get_dict()     # \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0439 \u043a\u043e\u0434 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430..<\/code><\/pre>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043a\u043e\u0434\u0430 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0432\u044b \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/p>\n<pre><code class=\"python\">import os from serpapi import GoogleSearch from google_scholar_organic_results import organic_results  def cite_results():      print(\"extracting cite results..\")      citation_results = []      for citation in organic_results():         params = {             \"api_key\": os.getenv(\"API_KEY\"), # \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 SerpApi             \"engine\": \"google_scholar_cite\", # # \u0434\u0432\u0438\u0436\u043e\u043a \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432             \"q\": citation[\"result_id\"]       # # FDc6HiktlqEJ ... FDc6Hikt21J         }          search = GoogleSearch(params)         results = search.get_dict()          print(f\"Currently extracting {citation['result_id']} citation ID.\")          for result in results[\"citations\"]:             cite_title = result[\"title\"]             cite_snippet = result[\"snippet\"]              citation_results.append({                 \"organic_result_title\": citation[\"title\"],                 \"organic_result_link\": citation[\"link\"],                 \"citation_title\": cite_title,                 \"citation_snippet\": cite_snippet             })      return citation_results <\/code><\/pre>\n<h4>\u041e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432<\/h4>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a <code>list()<\/code> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">citation_results = []<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c <code>for<\/code> \u0446\u0438\u043a\u043b \u0434\u043b\u044f \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e <code>organic_results()<\/code> \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c <code>result_id<\/code> \u0432 <code>\"q\"<\/code> \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<pre><code class=\"python\">for citation in organic_results():     params = {       \"api_key\": os.getenv(\"API_KEY\"), # \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 SerpApi       \"engine\": \"google_scholar_cite\", # # \u0434\u0432\u0438\u0436\u043e\u043a \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432       \"q\": citation[\"result_id\"]       # # FDc6HiktlqEJ ... FDc6Hikt21J     }      search = GoogleSearch(params)      # \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u0435 SerpApi     results = search.get_dict()        # JSON \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0432\u0442\u043e\u0440\u043e\u0439 <code>for<\/code> \u0446\u0438\u043a\u043b \u0438 \u0434\u043e\u0441\u0442\u0443\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u043a \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043a\u0430\u043a \u0438 \u0434\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f:<\/p>\n<pre><code class=\"python\">for result in results[\"citations\"]:     cite_title = result[\"title\"]     cite_snippet = result[\"snippet\"]<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0437\u0432\u0435\u043b\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a <code>list()<\/code> \u043a\u0430\u043a \u0441\u043b\u043e\u0432\u0430\u0440\u044c:<\/p>\n<pre><code class=\"python\">citation_results.append({     \"organic_result_title\": citation[\"title\"], # \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0426\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b     \"organic_result_link\": citation[\"link\"],   # \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0426\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b     \"citation_title\": cite_title,     \"citation_snippet\": cite_snippet })<\/code><\/pre>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a <code>list()<\/code>:<\/p>\n<pre><code class=\"python\">return citation_results<\/code><\/pre>\n<hr\/>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/13b\/1dc\/c8d\/13b1dcc8dd67f8eb33bd0c2b5d941c3e.png\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/13b\/1dc\/c8d\/13b1dcc8dd67f8eb33bd0c2b5d941c3e.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 CSV<\/h3>\n<p>\u041d\u0430\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0432 <code>DataFrame<\/code> <code>data<\/code> \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c <code>to_csv()<\/code>.<\/p>\n<pre><code class=\"python\">import pandas as pd from google_scholar_organic_results import organic_results from google_scholar_cite_results import cite_results  print(\"waiting for organic results to save..\") pd.DataFrame(data=organic_results())   .to_csv(\"google_scholar_organic_results.csv\", encoding=\"utf-8\", index=False)  print(\"waiting for cite results to save..\") pd.DataFrame(data=cite_results())   .to_csv(\"google_scholar_citation_results.csv\", encoding=\"utf-8\", index=False) <\/code><\/pre>\n<h4>\u041e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432 CSV<\/h4>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c <code>organic_results()<\/code> \u0438 <code>cite_results()<\/code> \u043e\u0442\u043a\u0443\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435, \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>pandas<\/code>:<\/p>\n<pre><code class=\"python\">import pandas as pd from google_scholar_organic_results import organic_results from google_scholar_cite_results import cite_results<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b <code>to_csv()<\/code>:<\/p>\n<pre><code class=\"python\">pd.DataFrame(data=organic_results()) \\     .to_csv(\"google_scholar_organic_results.csv\", encoding=\"utf-8\", index=False)<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b <code>to_csv()<\/code>:<\/p>\n<pre><code class=\"python\">pd.DataFrame(data=cite_results()) \\     .to_csv(\"google_scholar_citation_results.csv\", encoding=\"utf-8\", index=False)<\/code><\/pre>\n<ul>\n<li>\n<p><code>data<\/code> \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 <code>DataFrame<\/code> \u044d\u0442\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<\/li>\n<li>\n<p><code>encoding='utf-8'<\/code> \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043e. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u044d\u0442\u043e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u044f\u0432\u043d\u043e, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e \u0447\u0442\u043e \u044d\u0442\u043e \u0435\u0433\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p><code>index=False<\/code> \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0440\u0430\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043d\u043e\u043c\u0435\u0440\u0430 \u0441\u0442\u0440\u043e\u043a <code>pandas<\/code>.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ec9\/0ad\/47f\/ec90ad47f947e5deb6f803b3e73b8685.png\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ec9\/0ad\/47f\/ec90ad47f947e5deb6f803b3e73b8685.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 SQLite<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435 \u043e \u0442\u043e\u043c \u043a\u0430\u043a:<\/p>\n<ul>\n<li>\n<p>\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 SQLite \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>pandas<\/code>,<\/p>\n<\/li>\n<li>\n<p>\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442 SQLite,<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0438 \u0440\u0430\u0437\u0440\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 SQLite,<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b\/\u043a\u043e\u043b\u043e\u043d\u043a\u0438,<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 <code>for<\/code> \u0446\u0438\u043a\u043b\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e <a href=\"https:\/\/stackoverflow.com\/a\/19187244\/15164646\" rel=\"noopener noreferrer nofollow\">\u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442 SQLite<\/a>:<\/p>\n<pre><code>1. \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435     2. \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f         3. \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f     4. \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f 5. \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 <\/code><\/pre>\n<h4>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 SQLite \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f pandas<\/h4>\n<pre><code class=\"python\"># https:\/\/pandas.pydata.org\/docs\/reference\/api\/pandas.DataFrame.to_sql.html import sqlite3 import pandas as pd from google_scholar_organic_results import organic_results from google_scholar_cite_results import cite_results  conn = sqlite3.connect(\"google_scholar_results.db\")  # \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0440\u0443\u0447\u043d\u044b\u043c\u0438 SQL \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, # pandas \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.  # \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 SQLite pd.DataFrame(organic_results()).to_sql(name=\"google_scholar_organic_results\",                                         con=conn,                                         if_exists=\"append\",                                         index=False)  # \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 SQLite pd.DataFrame(cite_results()).to_sql(name=\"google_scholar_cite_results\",                                      con=conn,                                      if_exists=\"append\",                                      index=False)  conn.commit() conn.close()<\/code><\/pre>\n<ul>\n<li>\n<p><code>name<\/code> \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 SQL \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<\/li>\n<li>\n<p><code>con<\/code> \u044d\u0442\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><code>if_exists<\/code> \u0441\u043a\u0430\u0436\u0435\u0442 <code>pandas<\/code> \u043a\u0430\u043a \u0441\u0435\u0431\u044f \u0432\u0435\u0441\u0442\u0438 \u0435\u0441\u043b\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d\u043e \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <code>\"fail\"<\/code> \u0438 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 <code>raise<\/code> \u043e\u0448\u0438\u0431\u043a\u0443 <code>ValueError<\/code>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>pandas<\/code> \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<\/li>\n<li>\n<p><code>index=False<\/code> \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0440\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u043e\u0442 <code>DataFrame<\/code>.<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h4>\u0414\u0440\u0443\u0433\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b SQLite<\/h4>\n<pre><code class=\"python\">import sqlite3  conn = sqlite3.connect(\"google_scholar_results.db\")  conn.execute(\"\"\"CREATE TABLE google_scholar_organic_results (                 page_number integer,                 position integer,                 result_type text,                 title text,                  link text,                 snippet text,                 result_id text,                 publication_info_summary text,                 cited_by_count integer,                 cited_by_link text,                 cited_by_id text,                 total_versions integer,                 all_versions_link text,                 all_versions_id text,                 file_format text,                 file_title text,                 file_link text)\"\"\") conn.commit()               conn.execute(\"\"\"CREATE TABLE google_scholar_cite_results (                 organic_results_title text,                  organic_results_link text,                 citation_title text,                 citation_link text)\"\"\") conn.commit()  # \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b for item in organic_results():     conn.execute(\"\"\"INSERT INTO google_scholar_organic_results                     VALUES (:page_number,                             :position,                             :result_type,                             :title,                             :link,                             :snippet,                             :result_id,                             :publication_info_summary,                             :cited_by_count,                             :cited_by_link,                             :cited_by_id,                             :total_versions,                             :all_versions_link,                             :all_versions_id,                             :file_format,                             :file_title,                             :file_link)\"\"\",                      {\"page_number\": item[\"page_number\"],                       \"position\": item[\"position\"],                       \"result_type\": item[\"type\"],                       \"title\": item[\"title\"],                       \"link\": item[\"link\"],                       \"snippet\": item[\"snippet\"],                       \"result_id\": item[\"result_id\"],                       \"publication_info_summary\": item[\"publication_info_summary\"],                       \"cited_by_count\": item[\"cited_by_count\"],                       \"cited_by_link\": item[\"cited_by_link\"],                       \"cited_by_id\": item[\"cited_by_id\"],                       \"total_versions\": item[\"total_versions\"],                       \"all_versions_link\": item[\"all_versions_link\"],                       \"all_versions_id\": item[\"all_versions_id\"],                       \"file_format\": item[\"file_format\"],                       \"file_title\": item[\"file_title\"],                       \"file_link\": item[\"file_link\"]}) conn.commit()  # \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b for cite_result in cite_results():     conn.execute(\"\"\"INSERT INTO google_scholar_cite_results                      VALUES (:organic_result_title,                     :organic_result_link,                     :citation_title,                     :citation_snippet)\"\"\",                  {\"organic_result_title\": cite_result[\"organic_result_title\"],                   \"organic_result_link\": cite_result[\"organic_result_link\"],                   \"citation_title\": cite_result[\"citation_title\"],                   \"citation_snippet\": cite_result[\"citation_snippet\"]})  conn.commit() conn.close() # \u044f\u0432\u043d\u043e \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043d\u0435\u044f\u0432\u043d\u043e<\/code><\/pre>\n<h5>\u041e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b SQLite<\/h5>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c <code>sqlite3<\/code> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443:<\/p>\n<pre><code class=\"python\">import sqlite3 <\/code><\/pre>\n<p>\u0421\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c\u0441\u044f \u0441 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0434\u0430\u0451\u043c \u043d\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">conn = sqlite3.connect(\"google_scholar_results.db\")<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">conn.execute(\"\"\"CREATE TABLE google_scholar_organic_results (                 page_number integer,                 position integer,                 result_type text,                 title text,                  link text,                 snippet text,                 result_id text,                 publication_info_summary text,                 cited_by_count integer,                 cited_by_link text,                 cited_by_id text,                 total_versions integer,                 all_versions_link text,                 all_versions_id text,                 file_format text,                 file_title text,                 file_link text)\"\"\") conn.commit()<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">conn.execute(\"\"\"CREATE TABLE google_scholar_cite_results (             organic_results_title text,              organic_results_link text,             citation_title text,             citation_link text)\"\"\") conn.commit()<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>for<\/code> \u0446\u0438\u043a\u043b:<\/p>\n<pre><code class=\"python\">for item in organic_results():     conn.execute(\"\"\"INSERT INTO google_scholar_organic_results                     VALUES (:page_number,                             :position,                             :result_type,                             :title,                             :link,                             :snippet,                             :result_id,                             :publication_info_summary,                             :cited_by_count,                             :cited_by_link,                             :cited_by_id,                             :total_versions,                             :all_versions_link,                             :all_versions_id,                             :file_format,                             :file_title,                             :file_link)\"\"\",                      {\"page_number\": item[\"page_number\"],                       \"position\": item[\"position\"],                       \"result_type\": item[\"type\"],                       \"title\": item[\"title\"],                       \"link\": item[\"link\"],                       \"snippet\": item[\"snippet\"],                       \"result_id\": item[\"result_id\"],                       \"publication_info_summary\": item[\"publication_info_summary\"],                       \"cited_by_count\": item[\"cited_by_count\"],                       \"cited_by_link\": item[\"cited_by_link\"],                       \"cited_by_id\": item[\"cited_by_id\"],                       \"total_versions\": item[\"total_versions\"],                       \"all_versions_link\": item[\"all_versions_link\"],                       \"all_versions_id\": item[\"all_versions_id\"],                       \"file_format\": item[\"file_format\"],                       \"file_title\": item[\"file_title\"],                       \"file_link\": item[\"file_link\"]}) conn.commit()<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>for<\/code> \u0446\u0438\u043a\u043b:<\/p>\n<pre><code class=\"python\">for cite_result in cite_results():     conn.execute(\"\"\"INSERT INTO google_scholar_cite_results                      VALUES (:organic_result_title,                     :organic_result_link,                     :citation_title,                     :citation_snippet)\"\"\",                  {\"organic_result_title\": cite_result[\"organic_result_title\"],                   \"organic_result_link\": cite_result[\"organic_result_link\"],                   \"citation_title\": cite_result[\"citation_title\"],                   \"citation_snippet\": cite_result[\"citation_snippet\"]}) conn.commit()<\/code><\/pre>\n<p>\u0417\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c c\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">conn.close()<\/code><\/pre>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"python\"># \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b conn.execute(\"DELETE FROM google_scholar_organic_results\")  # \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 conn.execute(\"DROP TABLE google_scholar_organic_results\")  # \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043a\u043e\u043b\u043e\u043d\u043a\u0443 conn.execute(\"ALTER TABLE google_scholar_organic_results DROP COLUMN authors\")  # \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043b\u043d\u043a\u0443 conn.execute(\"ALTER TABLE google_scholar_organic_results ADD COLUMN snippet text\")<\/code><\/pre>\n<hr\/>\n<h3>\u041a\u043e\u0434 \u0446\u0435\u043b\u0438\u043a\u043e\u043c &#8212; \u043f\u0430\u0440\u0441\u0438\u043d\u0433<\/h3>\n<pre><code class=\"python\">import os from serpapi import GoogleSearch from urllib.parse import urlsplit, parse_qsl   def organic_results():     print(\"extracting organic results..\")      params = {         \"api_key\": os.getenv(\"API_KEY\"),         \"engine\": \"google_scholar\",         \"q\": \"minecraft redstone system structure characteristics strength\",  # \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441         \"hl\": \"en\",        # \u044f\u0437\u044b\u043a         \"as_ylo\": \"2017\",  # \u043e\u0442 2017         \"as_yhi\": \"2021\",  # \u0434\u043e 2021         \"start\": \"0\"     }      search = GoogleSearch(params)      organic_results_data = []      loop_is_true = True      while loop_is_true:         results = search.get_dict()          print(f\"Currently extracting page \u2116{results['serpapi_pagination']['current']}..\")          for result in results[\"organic_results\"]:             position = result[\"position\"]             title = result[\"title\"]             publication_info_summary = result[\"publication_info\"][\"summary\"]             result_id = result[\"result_id\"]             link = result.get(\"link\")             result_type = result.get(\"type\")             snippet = result.get(\"snippet\")                  try:               file_title = result[\"resources\"][0][\"title\"]             except: file_title = None                  try:               file_link = result[\"resources\"][0][\"link\"]             except: file_link = None                  try:               file_format = result[\"resources\"][0][\"file_format\"]             except: file_format = None                  try:               cited_by_count = int(result[\"inline_links\"][\"cited_by\"][\"total\"])             except: cited_by_count = None                  cited_by_id = result.get(\"inline_links\", {}).get(\"cited_by\", {}).get(\"cites_id\", {})             cited_by_link = result.get(\"inline_links\", {}).get(\"cited_by\", {}).get(\"link\", {})                  try:               total_versions = int(result[\"inline_links\"][\"versions\"][\"total\"])             except: total_versions = None                  all_versions_link = result.get(\"inline_links\", {}).get(\"versions\", {}).get(\"link\", {})             all_versions_id = result.get(\"inline_links\", {}).get(\"versions\", {}).get(\"cluster_id\", {})                  organic_results_data.append({               \"page_number\": results[\"serpapi_pagination\"][\"current\"],               \"position\": position + 1,               \"result_type\": result_type,               \"title\": title,               \"link\": link,               \"result_id\": result_id,               \"publication_info_summary\": publication_info_summary,               \"snippet\": snippet,               \"cited_by_count\": cited_by_count,               \"cited_by_link\": cited_by_link,               \"cited_by_id\": cited_by_id,               \"total_versions\": total_versions,               \"all_versions_link\": all_versions_link,               \"all_versions_id\": all_versions_id,               \"file_format\": file_format,               \"file_title\": file_title,               \"file_link\": file_link,             })              if \"next\" in results[\"serpapi_pagination\"]:                 search.params_dict.update(dict(parse_qsl(urlsplit(results[\"serpapi_pagination\"][\"next\"]).query)))             else:                 loop_is_true = False      return organic_results_data           def cite_results():      print(\"extracting cite results..\")      citation_results = []      for citation in organic_results():         params = {             \"api_key\": os.getenv(\"API_KEY\"),             \"engine\": \"google_scholar_cite\",             \"q\": citation[\"result_id\"]         }          search = GoogleSearch(params)         results = search.get_dict()          print(f\"Currently extracting {citation['result_id']} citation ID.\")          for result in results[\"citations\"]:             cite_title = result[\"title\"]             cite_snippet = result[\"snippet\"]              citation_results.append({                 \"organic_result_title\": citation[\"title\"],                 \"organic_result_link\": citation[\"link\"],                 \"citation_title\": cite_title,                 \"citation_snippet\": cite_snippet             })      return citation_results    # \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430 \u043f\u0440\u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432 SQL: ''' extracting organic results.. Currently extracting page \u21161.. Currently extracting page \u21162.. Currently extracting page \u21163.. Currently extracting page \u21164.. Currently extracting page \u21165.. Currently extracting page \u21166.. Done extracting organic results. Saved to SQL Lite database. '''<\/code><\/pre>\n<h3>\u041a\u043e\u0434 \u0446\u0435\u043b\u0438\u043a\u043e\u043c &#8212; \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/h3>\n<pre><code class=\"python\">import pandas as pd import sqlite3 from google_scholar_organic_results import organic_results from google_scholar_cite_results import cite_results  # \u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0411\u0414 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Pandas print(\"waiting for organic results to save..\") organic_df = pd.DataFrame(data=organic_results()) organic_df.to_csv(\"google_scholar_organic_results.csv\", encoding=\"utf-8\", index=False)  print(\"waiting for cite results to save..\") cite_df = pd.DataFrame(data=cite_results()) cite_df.to_csv(\"google_scholar_citation_results.csv\", encoding=\"utf-8\", index=False)  # ------------------------------  # \u0414\u0440\u0443\u0433\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0411\u0424 \u0432 \u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044f SQLite \u0437\u0430\u043f\u0440\u043e\u0441\u044b conn = sqlite3.connect(\"google_scholar_results.db\")  conn.execute(\"\"\"CREATE TABLE google_scholar_organic_results (                 page_number integer,                 position integer,                 result_type text,                 title text,                 link text,                 snippet text,                 result_id text,                 publication_info_summary text,                 cited_by_count integer,                 cited_by_link text,                 cited_by_id text,                 total_versions integer,                 all_versions_link text,                 all_versions_id text,                 file_format text,                 file_title text,                 file_link text)\"\"\") conn.commit()   conn.execute(\"\"\"CREATE TABLE google_scholar_cite_results (             organic_results_title text,             organic_results_link text,             citation_title text,             citation_link text)\"\"\") conn.commit()  for item in organic_results():     conn.execute(\"\"\"INSERT INTO google_scholar_organic_results                     VALUES (:page_number,                             :position,                             :result_type,                             :title,                             :link,                             :snippet,                             :result_id,                             :publication_info_summary,                             :cited_by_count,                             :cited_by_link,                             :cited_by_id,                             :total_versions,                             :all_versions_link,                             :all_versions_id,                             :file_format,                             :file_title,                             :file_link)\"\"\",                  {\"page_number\": item[\"page_number\"],                   \"position\": item[\"position\"],                   \"result_type\": item[\"type\"],                   \"title\": item[\"title\"],                   \"link\": item[\"link\"],                   \"snippet\": item[\"snippet\"],                   \"result_id\": item[\"result_id\"],                   \"publication_info_summary\": item[\"publication_info_summary\"],                   \"cited_by_count\": item[\"cited_by_count\"],                   \"cited_by_link\": item[\"cited_by_link\"],                   \"cited_by_id\": item[\"cited_by_id\"],                   \"total_versions\": item[\"total_versions\"],                   \"all_versions_link\": item[\"all_versions_link\"],                   \"all_versions_id\": item[\"all_versions_id\"],                   \"file_format\": item[\"file_format\"],                   \"file_title\": item[\"file_title\"],                   \"file_link\": item[\"file_link\"]}) conn.commit()   for cite_result in cite_results():     conn.execute(\"\"\"INSERT INTO google_scholar_cite_results                     VALUES (:organic_result_title,                     :organic_result_link,                     :citation_title,                     :citation_snippet)\"\"\",                  {\"organic_result_title\": cite_result[\"organic_result_title\"],                   \"organic_result_link\": cite_result[\"organic_result_link\"],                   \"citation_title\": cite_result[\"citation_title\"],                   \"citation_snippet\": cite_result[\"citation_snippet\"]})  conn.commit() conn.close() print(\"Saved to SQL Lite database.\")   # \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430: ''' extracting organic results.. Currently extracting page \u21161.. ... Currently extracting page \u21164.. extracting cite results.. extracting organic results.. Currently extracting page \u21161.. ... Currently extracting page \u21164.. Currently extracting 60l4wsP6Ps0J citation ID. Currently extracting 9hkhIFu_BhAJ citation ID. ... Saved to SQL Lite database. '''<\/code><\/pre>\n<hr\/>\n<h3>\u0421\u0441\u044b\u043b\u043a\u0438<\/h3>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/dimitryzub\/py-google-scholar-organic-cite-to-csv-sqlite\" rel=\"noopener noreferrer nofollow\">GitHub \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/replit.com\/@serpapi\/Scrape-historic-Google-Scholar-Organic-and-Citation-results#main.py\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u0441 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u043e\u043c, \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0432 CSV \u0432 \u043e\u043d\u043b\u0430\u0439\u043d IDE<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/serpapi.com\/google-scholar-api\" rel=\"noopener noreferrer nofollow\">Google Scholar API<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/serpapi.com\/libraries\" rel=\"noopener noreferrer nofollow\">SerpApi \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a><\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<h3>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435<\/h3>\n<p>\u0421 \u044d\u0442\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0438\u043b\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0434\u0438\u0441\u0446\u0438\u043f\u043b\u0438\u043d\u0435. \u041a\u043b\u0430\u0441\u0441\u043d\u044b\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u043a \u044d\u0442\u043e\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0435\u0433\u043e \u043a\u0430\u0436\u0434\u0443\u044e \u043d\u0435\u0434\u0435\u043b\u044e \u0438\u043b\u0438 \u043c\u0435\u0441\u044f\u0446 \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0431\u043b\u043e\u0433 \u043f\u043e\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0435 \u041f\u0440\u043e\u0444\u0438\u043b\u0435\u0439 \u0441 \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u0435\u0439, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0410\u0432\u0442\u043e\u0440\u0441\u043a\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0430\u0440\u0441\u0435\u0440 \u0441 \u043d\u0443\u043b\u044f, \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043e\u0431\u043e\u0439\u0442\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u043e\u0442 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u043a\u0430\u043a \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0438\u043b\u0438, \u043a\u0430\u043a \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 JavaScript &#8212; <a href=\"https:\/\/serpapi.com\/\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 SerpApi<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/serpapi.com\/#contact\" rel=\"noopener noreferrer nofollow\">\u0441\u0432\u044f\u0436\u0438\u0442\u0435\u0441\u044c \u0441 SerpApi<\/a>.<\/p>\n<hr\/>\n<p>\u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u043a \u043d\u0430\u043c \u043d\u0430 <a href=\"https:\/\/www.reddit.com\/r\/SerpApi\/\" rel=\"noopener noreferrer nofollow\">Reddit<\/a> | <a href=\"https:\/\/twitter.com\/serp_api\" rel=\"noopener noreferrer nofollow\">Twitter<\/a> | <a href=\"https:\/\/www.youtube.com\/channel\/UCUgIHlYBOD3yA3yDIRhg_mg\" rel=\"noopener noreferrer nofollow\">YouTube<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/647873\/\"> https:\/\/habr.com\/ru\/articles\/647873\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>?<strong>\u041a\u0440\u0430\u0442\u043a\u043e \u043e \u0441\u0443\u0442\u0438<\/strong>: \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 2017-2021 \u0433\u043e\u0434\u043e\u0432 \u0441 Google Scholar \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044e. \u0421\u043b\u0435\u0434\u043e\u043c \u0438\u0445 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432 CSV \u0438 SQLite \u0411\u0414 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Python \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0432\u0435\u0431-\u0441\u043a\u0440\u0435\u0439\u043f\u0438\u043d\u0433\u0430 \u043e\u0442 SerpApi.<\/p>\n<p>?<strong>\u0427\u0442\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f<\/strong>: \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0446\u0438\u043a\u043b\u043e\u0432, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439. \u0410 \u0442\u0430\u043a \u0436\u0435 <code>serpapi<\/code>, <code>urllib<\/code>, <code>pandas<\/code>, <code>sqlite3<\/code> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<p>\u23f1\ufe0f<strong>\u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0430\u0439\u043c\u0435\u0442<\/strong>: ~20-60 \u043c\u0438\u043d\u0443\u0442 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e.<\/p>\n<hr\/>\n<ul>\n<li>\n<p><a href=\"#what_will_be_scraped\" rel=\"noopener noreferrer nofollow\">\u0427\u0442\u043e \u043f\u0430\u0440\u0441\u0438\u043c<\/a> <\/p>\n<ul>\n<li>\n<p><a href=\"#prerequisites\" rel=\"noopener noreferrer nofollow\">\u0427\u0442\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f<\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#process\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e\u0446\u0435\u0441\u0441<\/a> <\/p>\n<ul>\n<li>\n<p><a href=\"#organic_results\" rel=\"noopener noreferrer nofollow\">\u041e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#cite_results\" rel=\"noopener noreferrer nofollow\">\u0426\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#save_csv\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 CSV<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#save_sqlite\" rel=\"noopener noreferrer nofollow\">\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 SQLite<\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"#full_code\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u0446\u0435\u043b\u0438\u043a\u043e\u043c &#8212; \u043f\u0430\u0440\u0441\u0438\u043d\u0433<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#saving_code\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u0434 \u0446\u0435\u043b\u0438\u043a\u043e\u043c &#8212; \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#links\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#outro\" rel=\"noopener noreferrer nofollow\">\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435<\/a><\/p>\n<\/li>\n<\/ul>\n<h3>\u0427\u0442\u043e \u043f\u0430\u0440\u0441\u0438\u043c<\/h3>\n<p>\u0418\u0437 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>?\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u041d\u0430 Google Scholar \u0435\u0441\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u0438\u043c\u0438\u0442 \u0432 100 \u0441\u0442\u0440\u0430\u043d\u0438\u0446, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 <code>About xxx.xxx results<\/code> \u044d\u0442\u043e \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c. \u0422\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 \u0413\u0443\u0433\u043b \u043f\u043e\u0438\u0441\u043a\u043e\u043c.<\/p>\n<p>\u0418\u0437 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u0427\u0442\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f<\/h3>\n<p><strong>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0438\u0440\u0443\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435<\/strong><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u043d\u0435\u0435, \u0432\u0437\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u043d\u0430 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0439 \u044d\u0442\u043e\u043c\u0443 \u0431\u043b\u043e\u0433 \u043f\u043e\u0441\u0442 \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 &#8212; <a href=\"https:\/\/serpapi.com\/blog\/python-virtual-environments-using-virtualenv-and-poetry\/\" rel=\"noopener noreferrer nofollow\">Python virtual environments tutorial using Virtualenv and Poetry<\/a>.<\/p>\n<p>\u0412\u043a\u0440\u0430\u0442\u0446\u0435, \u044d\u0442\u043e \u0448\u0442\u0443\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Python \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0447\u0442\u043e \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Python.<\/p>\n<p>?\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u0433\u0438\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435\u043c.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a:<\/p>\n<pre><code>pip install google-search-results pip install pandas<\/code><\/pre>\n<hr\/>\n<h3>\u041f\u0440\u043e\u0446\u0435\u0441\u0441<\/h3>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e:<\/p>\n<ul>\n<li>\n<p>\u0437\u0430\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u043a\u043e\u0434 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 <a href=\"#full_code\" rel=\"noopener noreferrer nofollow\">\u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0446\u0435\u043b\u0438\u043a\u043e\u043c<\/a>,<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/dimitryzub\/py-google-scholar-organic-cite-to-csv-sqlite\" rel=\"noopener noreferrer nofollow\">\u0437\u0430\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u043a\u043e\u0434 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0438\u0437 GitHub \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a>,<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/replit.com\/@serpapi\/Scrape-historic-Google-Scholar-Organic-and-Citation-results#main.py\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u0432 online IDE<\/a>.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u041e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h3>\n<pre><code class=\"python\">import os from serpapi import GoogleSearch from urllib.parse import urlsplit, parse_qsl   def organic_results():     print(\"extracting organic results..\")      params = {         \"api_key\": os.getenv(\"API_KEY\"), # \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 SerpApi          \"engine\": \"google_scholar\",         \"q\": \"minecraft redstone system structure characteristics strength\",  # \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441         \"hl\": \"en\",        # \u044f\u0437\u044b\u043a         \"as_ylo\": \"2017\",  # \u0441 2017         \"as_yhi\": \"2021\",  # \u0434\u043e 2021         \"start\": \"0\"       # \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430     }      search = GoogleSearch(params)      organic_results_data = []      loop_is_true = True      while loop_is_true:         results = search.get_dict()          print(f\"Currently extracting page \u2116{results['serpapi_pagination']['current']}..\")          for result in results[\"organic_results\"]:             position = result[\"position\"]             title = result[\"title\"]             publication_info_summary = result[\"publication_info\"][\"summary\"]             result_id = result[\"result_id\"]             link = result.get(\"link\")             result_type = result.get(\"type\")             snippet = result.get(\"snippet\")                try:               file_title = result[\"resources\"][0][\"title\"]             except: file_title = None                try:               file_link = result[\"resources\"][0][\"link\"]             except: file_link = None                try:               file_format = result[\"resources\"][0][\"file_format\"]             except: file_format = None                try:               cited_by_count = int(result[\"inline_links\"][\"cited_by\"][\"total\"])             except: cited_by_count = None                cited_by_id = result.get(\"inline_links\", {}).get(\"cited_by\", {}).get(\"cites_id\", {})             cited_by_link = result.get(\"inline_links\", {}).get(\"cited_by\", {}).get(\"link\", {})                try:               total_versions = int(result[\"inline_links\"][\"versions\"][\"total\"])             except: total_versions = None                all_versions_link = result.get(\"inline_links\", {}).get(\"versions\", {}).get(\"link\", {})             all_versions_id = result.get(\"inline_links\", {}).get(\"versions\", {}).get(\"cluster_id\", {})                organic_results_data.append({               \"page_number\": results[\"serpapi_pagination\"][\"current\"],               \"position\": position + 1,               \"result_type\": result_type,               \"title\": title,               \"link\": link,               \"result_id\": result_id,               \"publication_info_summary\": publication_info_summary,               \"snippet\": snippet,               \"cited_by_count\": cited_by_count,               \"cited_by_link\": cited_by_link,               \"cited_by_id\": cited_by_id,               \"total_versions\": total_versions,               \"all_versions_link\": all_versions_link,               \"all_versions_id\": all_versions_id,               \"file_format\": file_format,               \"file_title\": file_title,               \"file_link\": file_link,             })              if \"next\" in results[\"serpapi_pagination\"]:                 search.params_dict.update(dict(parse_qsl(urlsplit(results[\"serpapi_pagination\"][\"next\"]).query)))             else:                 loop_is_true = False      return organic_results_data<\/code><\/pre>\n<h4>\u041e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0433\u0438\u043d\u0430\u0446\u0438\u044e<\/h4>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c <code>os<\/code>, <code>serpapi<\/code>, <code>urllib<\/code> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<pre><code class=\"python\">import os from serpapi import GoogleSearch from urllib.parse import urlsplit, parse_qsl<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 <code>GoogleSearch()<\/code> \u0433\u0434\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0435 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u0435 SerpApi:<\/p>\n<pre><code class=\"python\">params = {   \"api_key\": os.getenv(\"API_KEY\"), # \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 SerpApi   \"engine\": \"google_scholar\",   \"q\": \"minecraft redstone system structure characteristics strength\",  # \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441   \"hl\": \"en\",        # \u044f\u0437\u044b\u043a   \"as_ylo\": \"2017\",  # \u0441 2017   \"as_yhi\": \"2021\",  # \u0434\u043e 2021   \"start\": \"0\"       # \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 }  search = GoogleSearch(params) # \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u0443\u0442<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a <code>list()<\/code> \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432 CSV \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b<code>cite_results()<\/code> \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\">organic_results_data = []<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c <code>while<\/code> \u0446\u0438\u043a\u043b \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e \u0432\u0441\u0435\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446:<\/p>\n<pre><code class=\"python\">loop_is_true = True  while loop_is_true:     results = search.get_dict()          # \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u0443\u0442\u0430\u0447\u043a\u0438..          if \"next\" in results[\"serpapi_pagination\"]:         search.params_dict.update(dict(parse_qsl(urlsplit(results[\"serpapi_pagination\"][\"next\"]).query)))     else:         loop_is_true = False <\/code><\/pre>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e <code>\"next\"<\/code> \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 &#8212; <code>while<\/code> \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 <code>loop_is_true<\/code> \u043d\u0430 <code>False<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e <code>\"next\"<\/code> \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, <code>search.params_dict.update<\/code> \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0441\u0442 \u0435\u0451 \u043a <code>GoogleSearch(params)<\/code> \u0434\u043b\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0430\u0440\u0441\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 <code>for<\/code> \u0446\u0438\u043a\u043b\u0435:<\/p>\n<pre><code class=\"python\">for result in results[\"organic_results\"]:     position = result[\"position\"]     title = result[\"title\"]     publication_info_summary = result[\"publication_info\"][\"summary\"]     result_id = result[\"result_id\"]     link = result.get(\"link\")     result_type = result.get(\"type\")     snippet = result.get(\"snippet\")        try:       file_title = result[\"resources\"][0][\"title\"]     except: file_title = None        try:       file_link = result[\"resources\"][0][\"link\"]     except: file_link = None        try:       file_format = result[\"resources\"][0][\"file_format\"]     except: file_format = None        try:       cited_by_count = int(result[\"inline_links\"][\"cited_by\"][\"total\"])     except: cited_by_count = None        cited_by_id = result.get(\"inline_links\", {}).get(\"cited_by\", {}).get(\"cites_id\", {})     cited_by_link = result.get(\"inline_links\", {}).get(\"cited_by\", {}).get(\"link\", {})        try:       total_versions = int(result[\"inline_links\"][\"versions\"][\"total\"])     except: total_versions = None        all_versions_link = result.get(\"inline_links\", {}).get(\"versions\", {}).get(\"link\", {})     all_versions_id = result.get(\"inline_links\", {}).get(\"versions\", {}).get(\"cluster_id\", {}) <\/code><\/pre>\n<ul>\n<li>\n<p><code>try\/except<\/code> \u0431\u043b\u043e\u043a\u0438 \u0431\u044b\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 <code>None<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0438\u0437 Google \u0431\u044d\u043a\u0435\u043d\u0434\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u0432 \u043e\u0434\u0438\u043d <code>try<\/code> \u0431\u043b\u043e\u043a, \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b, \u0438\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0435\u0441\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0430 \u0438\u043b\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0435\u0441\u0442\u044c \u0432 \u0432\u044b\u0434\u0430\u0447\u0435, \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d\u043e \u0432\u0435\u0440\u043d\u0451\u0442 <code>None<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0434\u0435\u0441\u044c \u043c\u043d\u043e\u0433\u043e <code>try\/except<\/code> \u0431\u043b\u043e\u043a\u043e\u0432.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 <code>list()<\/code> \u0441\u043f\u0438\u0441\u043e\u043a:<\/p>\n<pre><code class=\"python\">organic_results_data = []  # \u0442\u0443\u0442 \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u0438 while \u0446\u0438\u043a\u043b...   organic_results_data.append({     \"page_number\": results[\"serpapi_pagination\"][\"current\"],     \"position\": position + 1,     \"result_type\": result_type,     \"title\": title,     \"link\": link,     \"result_id\": result_id,     \"publication_info_summary\": publication_info_summary,     \"snippet\": snippet,     \"cited_by_count\": cited_by_count,     \"cited_by_link\": cited_by_link,     \"cited_by_id\": cited_by_id,     \"total_versions\": total_versions,     \"all_versions_link\": all_versions_link,     \"all_versions_id\": all_versions_id,     \"file_format\": file_format,     \"file_title\": file_title,     \"file_link\": file_link, })<\/code><\/pre>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 <code>list()<\/code> \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0437\u0436\u0435 \u043f\u0440\u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0435 \u0426\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">return organic_results_data<\/code><\/pre>\n<hr\/>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u0426\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u044b\u0434\u0430\u0447\u0438 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c <code>result_id<\/code> \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c <code>result_ids<\/code>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u041e\u0440\u0433\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\"># \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a result_ids  result_ids = [\"FDc6HiktlqEJ\"...\"FDc6Hikt21J\"] for citation in result_ids:     params = {         \"api_key\": \"API_KEY\",             # \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 SerpApi         \"engine\": \"google_scholar_cite\",  # \u0434\u0432\u0438\u0436\u043e\u043a \u0434\u043b\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432         \"q\": citation                     # FDc6HiktlqEJ ... FDc6Hikt21J     }     search = GoogleSearch(params)     results = search.get_dict()     # \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0439 \u043a\u043e\u0434 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430..<\/code><\/pre>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043a\u043e\u0434\u0430 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 \u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0432\u044b \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/p>\n<pre><code class=\"python\">import os from serpapi import GoogleSearch from google_scholar_organic_results import organic_results  def cite_results():      print(\"extracting cite results..\")      citation_results = []      for<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-409715","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/409715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=409715"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/409715\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=409715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=409715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=409715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}