Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sakan811 authored Oct 15, 2024
1 parent d0ead84 commit 6f5c21c
Showing 1 changed file with 66 additions and 6 deletions.
72 changes: 66 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,72 @@ A **lower Price/Review Score** indicates that the place is **not expensive**, ye
- You will see a message that shows your User Agent.
- Copy the User Agent.

2. **Edit the Configuration File**
- Open the `docker-compose.yml` file in a text editor (like Notepad).
- Look for the line that says `USER_AGENT`. Replace `your_user_agent` text with the User Agent you copied.
2. **Edit `.env` file**
- Rename the `.env.example` file to `.env`.
- Open the `.env` via a text editor like Notepad, etc.
- Look for the line that says `USER_AGENT`.
- Paste the User Agent you copied, for exaxmple:
```
USER_AGENT=copied_user_agent
```
- Where `copied_user_agent` is the User Agent you copied.
- Save the file and close the text editor.

### Step 3: Find Necessary Headers

1. **Open Booking.com**
- Go to [Booking.com](https://www.booking.com).
- Search for any destination (like "Tokyo" or "New York") to see a list of available places.

2. **Open Developer Tools:**
- Make sure you are on the page showing the available places for booking.
- Scroll down a bit on the page.
- Open the Developer Tools (a set of tools to inspect web pages):
- **For Chrome:**
- Right-click anywhere on the page.
- Click on `Inspect`.
- Click on the `Network` tab at the top of the Developer Tools.
- **For Firefox:**
- Right-click anywhere on the page.
- Click on `Inspect`.
- Click on the `Network` tab at the top.

3. **Find GraphQL Request:**
- In the search bar at the top of the Network tab, type `graphql`.
> If you don't see any `graphql` requests right away, scroll down the Booking.com page a little more.
> This will load more requests in the Network tab, and you may find the `graphql` request there.
4. **Inspect a Request:**
- Click on the request start with `graphql` or name `graphql` from the list in the Network tab.
- Look for the section labeled **Headers**. This section contains details about what was sent to the server.

5. **Find the Necessary Headers:**
- Look for these specific headers in the Headers section:
- `X-BOOKING-CONTEXT-ACTION-NAME`
- `X-BOOKING-CONTEXT-AID`
- `X-BOOKING-CSRF-TOKEN`
- `X-BOOKING-ET-SERIALIZED-STATE`
- `X-BOOKING-PAGEVIEW-ID`
- `X-BOOKING-SITE-TYPE-ID`
- `X-BOOKING-TOPIC`

6. **Copy Header Values:**
- For each header, right-click on it and select `Copy Value`. This copies the information to your clipboard.

7. **Save the Values Locally:**
- Open a text editor and create a new file named `.env`.
- Paste each copied value into the file next to its corresponding name, like this:
```
X_BOOKING_CONTEXT_ACTION_NAME=copied_action_name
X_BOOKING_CONTEXT_AID=copied_aid
X_BOOKING_CSRF_TOKEN=copied_csrf_token
X_BOOKING_ET_SERIALIZED_STATE=copied_serialized_state
X_BOOKING_PAGEVIEW_ID=copied_pageview_id
X_BOOKING_SITE_TYPE_ID=copied_site_type_id
X_BOOKING_TOPIC=copied_topic
```

### Step 3: Access the Web App
### Step 4: Access the Web App
1. **Start the Web App**
- Make sure that the Docker Desktop is running.
- If not, start the Docker Desktop.
Expand All @@ -53,7 +113,7 @@ A **lower Price/Review Score** indicates that the place is **not expensive**, ye
2. **Access the Web App**
- Open your web browser and go to: [http://localhost:5000/](http://localhost:5000/)

### Step 4: Stop the Web App
### Step 5: Stop the Web App
1. **Open Docker Desktop**
- Go to the **Containers** section.

Expand All @@ -69,4 +129,4 @@ A **lower Price/Review Score** indicates that the place is **not expensive**, ye
- If you leave this box unticked, the scraper will retrieve information on all types of places available through Booking.com in the specified city.

- When entering the **country** in the form, please provide the **full name** of the country.
- **Do not** use abbreviations.
- **Do not** use abbreviations.

0 comments on commit 6f5c21c

Please sign in to comment.