M
M
MihaSerg2020-06-09 10:08:09
Python
MihaSerg, 2020-06-09 10:08:09

How to force Selenium to load Russian Aliexpress?

Python 3.8
Need to parse the Aliexpress product listing page. An infinite scrolling page, so BeautifulSoup, if I understand correctly, will not work. I use Selenium, but it loads a page with a description of goods in English and prices in dollars, and the list of goods is not the same as on Ali in Russian. At the same time, the interface is in Russian.
How to force Selenium to load a list of products with a Russian description in rubles?

....
URL = 'https://flashdeals.aliexpress.com/ru.htm'
browser = webdriver.Chrome()
browser.get(URL)
html = browser.page_source
print(html)
....

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soremix, 2020-06-09
@MihaSerg

Region, region, city is defined in the cookie "aep_usuc_f"

driver.get('https://flashdeals.aliexpress.com/ru.htm')
cookie = {'name': 'aep_usuc_f', 'value': 'isfm=y&site=rus&c_tp=RUB&isb=y&region=RU&b_locale=ru_RU', 'domain': '.aliexpress.com'}
driver.add_cookie(cookie)
driver.get('https://flashdeals.aliexpress.com/ru.htm')

ps: you can still do it with requests and BS4, you just need to see where new products are loaded from. F12 -> Network, scroll down to load products and see which browser sent the request. There it remains to figure out how it is built, make your own and send them, receiving information

R
Robur, 2020-06-09
@Robur

a lot of people are struggling with how to force aliexpress to issue goods in English and in dollars.
Therefore, the assumption is this - try to log in first to an account whose country is Russia.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question