I want to create a crawler.
As an exercise, I would like to acquire the tabelog shop information and save it individually in the DB.
require'nokogiri' require'anemone' require'open-uri' # Target URL url = "https://tabelog.com/" html = open (url) .read Carve with # Nokogiri doc = Nokogiri :: HTML (html, url) # Display the title of the office puts "store name" doc.css ('h1'). each do | link | puts link.content link = Shop.new link.name = link.content link.save end
At this time,
Nationwide gourmet restaurant guide Tabelog
You can display it like this.
However, I would like to eat this and go around the tabelog site to get the name of the store.
If i am familiar with this, please let me know.
Answer # 1
First of all, if you get the information by this method of the questioner and use the shop information on your own HP, you can use it without permission.
Normally, when doing this kind of thing, a mechanism called Web API is used.
(Google, youtube, etc. can also be used this way)
This is provided by the service side. Other than using this, it is NG.
It seems that tabelog was provided before
It seems that he is not going now.
Since the tabelog API has been discontinued, I searched for an alternative API (list)
- ruby on rails - i want to create a like function with rails
- ruby - [rails] i want to create a page where the url does not change by redirect even if i enter a value and search like a site
- ruby - i can't "rails db: create rails_env = production" on aws
- ruby - i want to create a checkbox with the opposite meaning in the rails checkbox (for the same model, i want to create a check
- ruby - create 3 or more columns in the intermediate table | db design
- ruby - i want to transition from create to show with rails
- create hidden_field using ruby hash
- i want to create a search site using youtube api with ruby on rails
- ruby - how to create a seed file associated with user
- ruby - i want to create a database on aws
- ruby - unable to run rake db: create rails_env = production on aws deployment
- ruby - unable to create app database on heroku
- ruby - i want to create sample data using a gem called rails faker
- ruby - rails even if i create a new model (user), it is not displayed
- ruby - how to create a fixed chat room
- ruby - i want to import from csv data and update or create a new db
- ruby on rails - i want to create a screen with a calendar display for 2 weeks like the attachment
- ruby on rails - i can't create a database with rails db: create
- ruby - i can't save in create mezzotte of rails
- ruby - i want to get records that match multiple foreign keys from within an intermediate table
- ruby - about how to save db with rails devise
- ruby - when i try to save data from rails console, id, created_at, updated_at become nil
- how to write in ruby multiple loop controller
- ruby - output the total integer value held by each user
- ruby - i want to use two rails renders
- ruby - i can't get a payjp token on aws
- html - i want it to be rendered if the search word is incorrect
- ruby - about viewport introduction
- ruby - [rails] about the error that occurs when deleting likes (routing error)