diff --git a/.github/PULL_REQUEST_TEMPLATE/new-data.yml b/.github/PULL_REQUEST_TEMPLATE/new-data.yml new file mode 100644 index 0000000..2ea8fbd --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/new-data.yml @@ -0,0 +1,3 @@ +name: 🐞 New data +description: add new data +title: "[new_data] " \ No newline at end of file diff --git a/main.py b/main.py index 12cb72c..018a578 100644 --- a/main.py +++ b/main.py @@ -1,10 +1,6 @@ import pandas as pd import requests -headers = { - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3" - } - -r = requests.get('https://dados.pbh.gov.br/dataset/cadastro-imobiliario-regional-venda-nova', headers=headers, verify=False) - -print(r.status_code) \ No newline at end of file +headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"} +r = requests.get('https://dados.pbh.gov.br/dataset/cadastro-imobiliario-regional-pampulha', headers=headers, verify=False) +print(r.cookies) \ No newline at end of file diff --git a/requests.ipynb b/requests.ipynb new file mode 100644 index 0000000..c1c9c2e --- /dev/null +++ b/requests.ipynb @@ -0,0 +1,89 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/tricktx/.pyenv/versions/3.9.17/lib/python3.9/site-packages/urllib3/connectionpool.py:1103: InsecureRequestWarning: Unverified HTTPS request is being made to host 'dados.pbh.gov.br'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings\n", + " warnings.warn(\n" + ] + } + ], + "source": [ + "import pandas as pd\n", + "import requests\n", + "\n", + "headers = {\"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3\"}\n", + "r = requests.get('https://dados.pbh.gov.br/dataset/cadastro-imobiliario-regional-pampulha', headers=headers, verify=False)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "403" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "r.status_code" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Cookie Domaindados.pbh.gov.br\n", + "Cookie Name__goc_session__\n", + "Cookie Valuerwpgoxluszntgjxlvnnzgdrjyjocthhh\n" + ] + } + ], + "source": [ + "for cookie in r.cookies:\n", + " print(\"Cookie Domain\" + cookie.domain)\n", + " print(\"Cookie Name\" + cookie.name)\n", + " print(\"Cookie Value\" + cookie.value)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.17" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}