Skip to content

Commit

Permalink
test template pr
Browse files Browse the repository at this point in the history
  • Loading branch information
tricktx committed Sep 17, 2024
1 parent 0a37936 commit b8e9824
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/new-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: 🐞 New data
description: add new data
title: "[new_data] <title>"
10 changes: 3 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
@@ -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)
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)
89 changes: 89 additions & 0 deletions requests.ipynb
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit b8e9824

Please sign in to comment.