A
A
Andrey Prenrek2021-06-12 13:25:48
Python
Andrey Prenrek, 2021-06-12 13:25:48

How to parse missing data in python?

I'm trying to parse the site: https://aptekamos.ru/magaziny/apteki/apteka-gut-22...
The site takes medicines from this request:
https://aptekamos.ru/magaziny/apteki/apteka-gut-22. ..
The matter is that this request displays only a small part of that that actually is. And if you search in a search engine on the site, then the same query gives other data
. How to parse all the data from this query, and not just a certain part?
My code:

import requests
from bs4 import BeautifulSoup
import csv
from fake_useragent import UserAgent
headers = {'User-Agent': UserAgent().chrome,
                    "referer":"https://aptekamos.ru/magaziny/apteki/apteka-gut-22-ximki-germana-titova-12-k-2-11419/ob-apteke?m=1#1"}
response=requests.get("https://aptekamos.ru/magaziny/apteki/apteka-gut-22-ximki-germana-titova-12-k-2-11419/price-list?m=1",headers=headers)
for key, value in response.request.headers.items():
    print(key+": "+value)
soup2=BeautifulSoup(response.content, "html.parser")
items=soup2.findAll('span',class_="ama-button-1 ama-pl-pos-add")
for i in items:
    name=i.get("data-item-name")
    print(name)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question