K
K
kakaduwka2021-05-07 22:30:26
Parsing
kakaduwka, 2021-05-07 22:30:26

Parsing olx numbers?

Hello, I can’t parse olx phone numbers with a request through the requests module, before there was a pt parameter, now you need to get a parameter in the headers that is generated by js, I looked at the js code, it’s a complete mess
Can someone tell me how to parse a phone number with a request, selenium is not needed, because speed is important
Tell me how to properly debug js scripts, or if someone throws off the code I will be grateful

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Antonio Solo, 2021-05-08
@kakaduwka

without executing js code in any way. that is, someone is needed who will execute this js. and the choice is actually not great - selenium, phantom, puppeteer
ps I missed something?
need speed - parallel

M
Master Ruby, 2021-10-04
@Dunaevlad

How do I get information:

import requests

headers = {
    'Accept':'*/*',
    'Host': 'www.olx.ua',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode    ': 'cors',
    'Sec-Fetch-Site': 'same-origin',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0', 
    'X-Platform-Type': 'mobile-html5',
    'Authorization': 'Bearer d1010d86244a2895e25e47e10d696b46290e2a92',
}


print(requests.get(
    'https://www.olx.ua/api/v1/offers/719974471/limited-phones/',
    headers=headers,
    # cookies=cookie
).text)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question