From 728b29a87f45db08da883057b514e2dcf3049431 Mon Sep 17 00:00:00 2001 From: Christoph Gerneth Date: Sat, 17 Oct 2015 22:38:53 -0500 Subject: updated to beautifulsoup 4.4.1 --- bvggrabber/api/actualdeparture.py | 2 +- bvggrabber/api/scheduleddeparture.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bvggrabber/api/actualdeparture.py b/bvggrabber/api/actualdeparture.py index a1b3b5a..e7c084b 100644 --- a/bvggrabber/api/actualdeparture.py +++ b/bvggrabber/api/actualdeparture.py @@ -30,7 +30,7 @@ class ActualDepartureQueryApi(QueryApi): } response = requests.get(ACTUAL_API_ENDPOINT, params=params) if response.ok: - soup = BeautifulSoup(response.text) + soup = BeautifulSoup(response.text, "html.parser") if soup.find_all('form'): # The station we are looking for is ambiguous or does not exist stations = soup.find_all('option') diff --git a/bvggrabber/api/scheduleddeparture.py b/bvggrabber/api/scheduleddeparture.py index 7a30d5f..f316b6e 100644 --- a/bvggrabber/api/scheduleddeparture.py +++ b/bvggrabber/api/scheduleddeparture.py @@ -50,7 +50,7 @@ class ScheduledDepartureQueryApi(QueryApi): 'start': 'yes'} response = requests.get(SCHEDULED_API_ENDPOINT, params=params) if response.ok: - soup = BeautifulSoup(response.text) + soup = BeautifulSoup(response.text, "html.parser") if soup.find('span', 'error'): # The station we are looking for is ambiguous or does not exist stations = soup.find('span', 'select').find_all('a') diff --git a/setup.py b/setup.py index a57f3db..8661e64 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ setup( packages=find_packages(exclude=['tests']), include_package_data=True, install_requires=[ - 'beautifulsoup4>=4.2.1', + 'beautifulsoup4>=4.4.1', 'python-dateutil>=2.1', 'requests>=1.2.3', 'six>=1.3.0', -- cgit v1.2.3 From a02bbe591bdf72423f4246815402ab23c61247b5 Mon Sep 17 00:00:00 2001 From: Christoph Gerneth Date: Sat, 17 Oct 2015 22:40:00 -0500 Subject: minor change in filewriting method --- bvg-grabber.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bvg-grabber.py b/bvg-grabber.py index 3964f83..3a2d623 100755 --- a/bvg-grabber.py +++ b/bvg-grabber.py @@ -59,7 +59,5 @@ if __name__ == '__main__': if args.file in ('stdout', '-'): print(res.to_json) else: - file = open(args.file, 'w') - print(res.to_json, file=file) - file.close() - + with open(args.file, 'w') as f: + print(res.to_json, file=f) \ No newline at end of file -- cgit v1.2.3