royopa / morph-petrobras-scraper

Preços do diesel e da gasolina em R$ disponibilizados pela Petrobras


This is a scraper that runs on Morph. To get started see the documentation

Contributors royopa

Last run failed with status code 1.

Console output of last run

Injecting configuration and compiling...  -----> Python app detected -----> Installing python-2.7.14 -----> Installing pip -----> Installing requirements with pip  DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.  Obtaining scraperwiki from git+http://github.com/openaustralia/scraperwiki-python.git@morph_defaults#egg=scraperwiki (from -r /tmp/build/requirements.txt (line 6))  Cloning http://github.com/openaustralia/scraperwiki-python.git (to revision morph_defaults) to /app/.heroku/src/scraperwiki  Running command git clone -q http://github.com/openaustralia/scraperwiki-python.git /app/.heroku/src/scraperwiki  Running command git checkout -b morph_defaults --track origin/morph_defaults  Switched to a new branch 'morph_defaults'  Branch morph_defaults set up to track remote branch morph_defaults from origin.  Collecting lxml  Downloading lxml-4.8.0-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl (5.5 MB)  Collecting cssselect  Downloading cssselect-1.1.0-py2.py3-none-any.whl (16 kB)  Collecting requests  Downloading requests-2.27.1-py2.py3-none-any.whl (63 kB)  Collecting pandas  Downloading pandas-0.24.2-cp27-cp27mu-manylinux1_x86_64.whl (10.1 MB)  Collecting dumptruck>=0.1.2  Downloading dumptruck-0.1.6.tar.gz (15 kB)  Collecting idna<3,>=2.5; python_version < "3"  Downloading idna-2.10-py2.py3-none-any.whl (58 kB)  Collecting certifi>=2017.4.17  Downloading certifi-2021.10.8-py2.py3-none-any.whl (149 kB)  Collecting chardet<5,>=3.0.2; python_version < "3"  Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)  Collecting urllib3<1.27,>=1.21.1  Downloading urllib3-1.26.9-py2.py3-none-any.whl (138 kB)  Collecting numpy>=1.12.0  Downloading numpy-1.16.6-cp27-cp27mu-manylinux1_x86_64.whl (17.0 MB)  Collecting pytz>=2011k  Downloading pytz-2022.1-py2.py3-none-any.whl (503 kB)  Collecting python-dateutil>=2.5.0  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)  Collecting six>=1.5  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)  Building wheels for collected packages: dumptruck  Building wheel for dumptruck (setup.py): started  Building wheel for dumptruck (setup.py): finished with status 'done'  Created wheel for dumptruck: filename=dumptruck-0.1.6-py2-none-any.whl size=11844 sha256=1b5320a588f078c0854beadd363ec18e406e3c5ad20d7c29130970107720c7e9  Stored in directory: /tmp/pip-ephem-wheel-cache-oQSpHK/wheels/dc/75/e9/1e61c4080c73e7bda99614549591f83b53bcc2d682f26fce62  Successfully built dumptruck  Installing collected packages: dumptruck, idna, certifi, chardet, urllib3, requests, scraperwiki, lxml, cssselect, numpy, pytz, six, python-dateutil, pandas  Running setup.py develop for scraperwiki  Successfully installed certifi-2021.10.8 chardet-4.0.0 cssselect-1.1.0 dumptruck-0.1.6 idna-2.10 lxml-4.8.0 numpy-1.16.6 pandas-0.24.2 python-dateutil-2.8.2 pytz-2022.1 requests-2.27.1 scraperwiki six-1.16.0 urllib3-1.26.9 DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.    -----> Discovering process types  Procfile declares types -> scraper Injecting scraper and running... Traceback (most recent call last): File "scraper.py", line 8, in <module> df = pd.read_json(url) File "/app/.heroku/python/lib/python2.7/site-packages/pandas/io/json/json.py", line 413, in read_json path_or_buf, encoding=encoding, compression=compression, File "/app/.heroku/python/lib/python2.7/site-packages/pandas/io/common.py", line 202, in get_filepath_or_buffer req = _urlopen(filepath_or_buffer) File "/app/.heroku/python/lib/python2.7/urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "/app/.heroku/python/lib/python2.7/urllib2.py", line 435, in open response = meth(req, response) File "/app/.heroku/python/lib/python2.7/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/app/.heroku/python/lib/python2.7/urllib2.py", line 473, in error return self._call_chain(*args) File "/app/.heroku/python/lib/python2.7/urllib2.py", line 407, in _call_chain result = func(*args) File "/app/.heroku/python/lib/python2.7/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 403: Forbidden

Data

Downloaded 2 times by royopa

To download data sign in with GitHub

Download table (as CSV) Download SQLite database (12 KB) Use the API

rows 10 / 99

vr_gasolina data_variacao vr_diesel data_publicacao
1.9354
2019-04-19
2.247
2019-04-18
1.9354
2019-04-18
2.247
2019-04-17
1.9354
2019-04-17
2.1432
2019-04-16
1.9354
2019-04-16
2.1432
2019-04-15
1.9354
2019-04-13
2.1432
2019-04-12
1.9354
2019-04-12
2.1432
2019-04-11
1.9354
2019-04-11
2.1432
2019-04-10
1.9354
2019-04-10
2.1432
2019-04-09
1.9354
2019-04-09
2.1432
2019-04-08
1.9354
2019-04-06
2.1432
2019-04-05

Statistics

Average successful run time: 2 minutes

Total run time: 1 day

Total cpu time used: 27 minutes

Total disk space used: 49.6 KB

History

  • Auto ran revision b471195e and failed .
    nothing changed in the database
  • Auto ran revision b471195e and failed .
    nothing changed in the database
  • Auto ran revision b471195e and failed .
    nothing changed in the database
  • Auto ran revision b471195e and failed .
    nothing changed in the database
  • Auto ran revision b471195e and failed .
    nothing changed in the database
  • ...
  • Created on morph.io

Show complete history

Scraper code

Python

morph-petrobras-scraper / scraper.py