Sep-18-2019, 03:46 PM
I'm trying to get all the names of restaurants with 'food' keyword from the following website. However, I need to learn more things in order to just pick out the names. So I just want to try out to scrape all the page first but having trouble.
My codes:
import requests
from bs4 import BeautifulSoup
url = 'https://map.naver.com'
req = requests.get(url)
bs = BeautifulSoup(req.text, 'html.parser')
print(bs)
The result:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br/>
</p>
</body></html>
My codes:
import requests
from bs4 import BeautifulSoup
url = 'https://map.naver.com'
req = requests.get(url)
bs = BeautifulSoup(req.text, 'html.parser')
print(bs)
The result:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br/>
</p>
</body></html>