Open
Conversation
…dates, related code updated
tour_site_scraper.rb
Outdated
| ticket_summary_in&.each do |ticket_cmpany_in| | ||
| puts ticket_cmpany_in.text.to_s + ', ' | ||
| end | ||
| # binding.pry |
tour_site_scraper.rb
Outdated
| puts "Total tickets found for out is = " + total_ticket_out_found.to_s | ||
| puts "Total tickets found for in is = " + total_ticket_in_found.to_s | ||
|
|
||
| DB.execute("INSERT INTO tickets_summary values(?, ?, ?, ?, ?, ?, ?, ? )", [nil, departure_date.to_s, return_date.to_s, TIME_FROM_OUT, TIME_TO_OUT, Time.now.strftime("%Y-%m-%d %H:%M:%S"), total_ticket_out_found, total_ticket_in_found]) |
There was a problem hiding this comment.
Please limit to 80 character per line for all. Ref: Ruby Style Guide
tour_site_scraper.rb
Outdated
| DB.execute("INSERT INTO tickets_summary values(?, ?, ?, ?, ?, ?, ?, ? )", [nil, departure_date.to_s, return_date.to_s, TIME_FROM_OUT, TIME_TO_OUT, Time.now.strftime("%Y-%m-%d %H:%M:%S"), total_ticket_out_found, total_ticket_in_found]) | ||
| ticket_summary_id = DB.last_insert_row_id() | ||
| all_ticket_out_lists.each do |tickets_out| | ||
| DB.execute("INSERT INTO tickets_airline_companies values(?, ?, ?, ?, ?, ?)", [nil, ticket_summary_id, tickets_out[:ticket_company_name], tickets_out[:ticket_minimum_price], tickets_out[:number_of_ticket_found], 'out']) |
tour_site_scraper.rb
Outdated
| flight_data['flight_price'] = ticket_flight.find_elements(:css, '.ticket-detail-item .ticket-detail-item-inner .ticket-price > label > b')[0].attribute("innerHTML") | ||
| flight_data['flight_seat'] = ticket_flight.find_elements(:css, '.ticket-detail-item .ticket-detail-item-inner .ticket-detail-type .ticket-detail-icon .icon-seat')[0].attribute("innerHTML") | ||
| flight_data['flight_changable_status'] = ticket_flight.find_elements(:css, '.ticket-detail-item .ticket-detail-item-inner .ticket-detail-type .ticket-detail-icon .icon-date')[0].attribute("innerHTML") | ||
| flight_data['flight_type'] = ticket_flight.find_elements(:css, '.ticket-detail-item .ticket-detail-item-inner .ticket-detail-type .ticket-detail-type-text .ticket-detail-type-text-ellipsis')[0].attribute("innerHTML") |
There was a problem hiding this comment.
80 character per line. Ref: Ruby Style Guide
tour_site_scraper.rb
Outdated
|
|
||
| MAX_RETRY = 100 | ||
| WAIT = Selenium::WebDriver::Wait.new(timeout: 20) | ||
| DB = SQLite3::Database.new( "db_tour_scraper.db" ) |
There was a problem hiding this comment.
new("db_tour_scraper.db")
Ref: spaces-and-braces
migration.rb
Outdated
| FOREIGN KEY(ticket_airline_id) REFERENCES tickets_airlines(id) | ||
| ); | ||
| SQL | ||
|
|
tour_site_scraper.rb
Outdated
| Time.now.strftime("%Y-%m-%d %H:%M:%S"), | ||
| total_ticket_out_found, total_ticket_in_found | ||
| ] | ||
| DB.execute("INSERT INTO tickets_summary values(?, ?, ?, ?, ?, ?, ?, ? )", ) |
There was a problem hiding this comment.
What are the values it is inserting? Should it use ticket_summary_data in the interpolation!
tour_site_scraper.rb
Outdated
| tickets_out[:number_of_ticket_found], | ||
| 'out' | ||
| ] | ||
| DB.execute("INSERT INTO tickets_airline_companies values(?, ?, ?, ?, ?, ?)", ) |
There was a problem hiding this comment.
DB.execute("INSERT INTO tickets_airline_companies values(?, ?, ?, ?, ?, ?)", company_data)
mdmahmudurrahman
approved these changes
Dec 15, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 概要 | Summary
This implementation will save scraped data to SQLite database.
🔖 関連URL | Related links
Task link:
https://bitfountain.atlassian.net/jira/software/projects/SCRAPING/boards/9?selectedIssue=SCRAPING-6
Related doc:
https://docs.google.com/presentation/d/1UsAT649j4wdaq_UEjzEZENnVgIJWSWWIcD8RrrRb7FQ/edit#slide=id.g105796642e1_0_0
Database Design Details:
https://bitfountain.atlassian.net/wiki/spaces/GENERAL/pages/292225054/Database+design+details+description
変更点 | Changes
備考 | Remarks
📸 UI変更点 | changes on UI