D
D
Danil Neskazhu2020-04-23 08:31:11
Python
Danil Neskazhu, 2020-04-23 08:31:11

What to learn to implement a bot that will look for discounts on certain sites?

I want to write a bot in the TG, which, at the request of a person, will look for the biggest discount on the game on 3 sites.
For example, a person wrote to the bot: PUBG
And the bot went to 3 sites, entered this phrase into the search, went through the first search result, copied the price tag, discount, went through the buy tab and copied its URL.
How to implement it?
What PYthon libraries or methods should I learn and use? And if possible, then in more detail, which sections should I study?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
DevMan, 2020-04-23
@dannight0151

you need to learn at least 3 things:
1. what is parsing
2. how to parse in python
3. how to process and compare the received data,
then all that remains is to learn how to write a bot and combine it with the received data.
but this is not certain: there is a suspicion that the matter will stall at the points described above.

D
Daniil Chernov, 2020-04-23
@dancha

You will need basic knowledge of the language, be able to correctly apply cycles and conditions.
More specifically, for your bot you need to learn how to use the selenium library.
Read a series of these articles:
https://habr.com/ru/post/248559/
And you will already have a 100% idea of ​​how to implement your bot.

S
soremix, 2020-04-23
@SoreMix

In fact, everything is not so difficult.
You are making a bot for telegrams, as I understand it, you already know how.
Next, take a search phrase (let's say Fallout New Vegas), now you need to make a request to a site with discounts.
If the site has an API - do it through it. If there is no API, then there will be something like the following scheme:

  1. Find what the search query looks like on the site (for example site.com/search?q=fallout%20new%20vegas)
  2. Using the library, requestsmake a similar request to the site
  3. Using the library BeautifulSoup 4, parse the page, find the first link from the search results, go to it throughrequests
  4. Parse the new game page again via bs4 to find the price

And so with each of the necessary sites.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question