Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The /api/atlas/attractions/<country> endpoint is giving a status code of 200, but a result of null #4

Open
CLLane opened this issue Oct 26, 2019 · 1 comment

Comments

@CLLane
Copy link

CLLane commented Oct 26, 2019

Problem

I am trying to make a call through post man to
/api/atlas/attractions/japan?city=tokyo&sort=recent&limit=3
and the status code I am receiving is a 200 OK, however the object I am being returned is:

{
    "status": "success",
    "results": null,
    "Attractions": null
}

The other endpoints are working fine and I am getting back data.

Not sure what is going on but I thought I would throw this up here and see if anyone had suggestions.

@mileyvirus
Copy link
Contributor

mileyvirus commented Feb 12, 2020

The classes for the /things-to-do/ pages changed so it's only a matter of updating them.

Check pull request #5

So in scraper.py, replace everything from line 60 to line 83 with:

	for card in soup.find_all('a',
	class_='Card --content-card-v2 --content-card-item Card--flat')[:limit]:
		# CREATE NEW ATTRACTION
		curr_attraction = {}
		# LOCATION (City, Town)
		curr_attraction['location'] = card.find('div',
		class_='Card__hat --place').text
		# NAME
		curr_attraction['name'] = card.find('h3',
		class_='Card__heading --content-card-v2-title').find("span").text
		# Description
		curr_attraction['description'] = card.find('div',
		class_='Card__content js-subtitle-content').text
		# Coordinates
		curr_attraction['coordinates'] = [float(card["data-lat"]), float(card["data-lng"])]
		# Image Thumbnail
		curr_attraction['img'] = card.find('img')['data-src']
		# PATH
		curr_attraction['path'] = card['href']

		attractions.append(curr_attraction)

	return attractions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants