public-roadmap icon indicating copy to clipboard operation
public-roadmap copied to clipboard

[Knowledge Graph API] Support "details" modal

Open hartator opened this issue 3 years ago • 2 comments

image

image

Ref: https://serpapi.com/playground?q=AW3423DW&location=Austin%2C+Texas%2C+United+States&gl=us&hl=en

hartator avatar May 02 '22 20:05 hartator

Just sharing insights:

Information on the details modal is within the raw html: details

However, responsible parts for extracting it doesn't have id for js extraction, and the element with js-data is not extracting responsible part with the methods we have (plus, it is an element that contains both modals, reviews and details). If we can find a way to tie the existing details element .XpqX9[data-name="details"] to a body in html that is carefully extracted, we can have a solution. details2

I tried and couldn't find a solution to it.

kagermanov27 avatar Jun 23 '22 08:06 kagermanov27

id = doc.at_css('.psgQSb[data-name="details"]').id
# => "_Hc25Yrz-EZmC0PEP_aaRkA8115"

extract_js_div(id)

# parse data as usual

I can expand my comment if more explanation is needed :-)

ilyazub avatar Jun 27 '22 15:06 ilyazub

We have implemented the details modal. It's working on production.

image image Playground

ishiharaf avatar Aug 28 '24 09:08 ishiharaf