Capturing/scraping book genre information from google - automation

When I search for a book on google (search query: book title + genre e.g. of 'mice and men genre') I get the book genre(s) in a box which is above the search results. Sometimes there are multiple genres and sometimes just the one.
How can I capture this data?
I have a large list of books which I need the Genre information for. Are there any automated methods to gather this data? or alternative sources?

Related

How can i get genres and descriptions of movies in IMBd API?

so Im using the Top 250 Movies database in IMDb's API and i need the genres and descriptions of all the movies but i looked in IMDb's API list and they don't have anything about genres or descriptions.
I just want the genres and the short description on the IMDb website when you are on a movie.
And if anyones want to know i exporting the data into a spreadsheet. google sheets to be specific.
Use the following IMPORTXML:
For Plot use :
=IMPORTXML("imdb movie url","//*[#data-testid='plot-xl']")
For Genres use :
=IMPORTXML("imdb movie url","//*[#data-testid='genres']")
Example:
Reference:
IMPORTXML
XPath

Searching a word on all fields of an index with solr 8.9

I'm fetching some datas from a sql database using the DIH of Solr. I created a field all as this :
and I would like to be able to use it to search on all fields thought it. so like if I do he query "John" it would match with a title and a author name.
Actually I have a problem, when I do a query on the all field it only works on a perfect match.
For exemple, if I search name:lub it returns
"name":"CR2/LUB/ Lub oil pump",
"all":["1706443412665794562",
"2165C92A-D107-48A6-A410-08D92AA77517",
"CR2/BER/CRACK/LUB/OT/10-PU-200C",
"CR2/LUB/ Lub oil pump"],
Which is good
But if I search all:lub the response show :
"numFound":0,"start":0,"numFoundExact":true,"docs.
The ultimate goal being to be able to use a word to search on all fields, and to ponderate the weight of the different fields.
Like, if someone search John for books it finds it in the title , and in the author fields (by looking in the all) and then ponderate, by making the title more important and viewing in the response the score of each document
Thanks in advance for your advice!

How to get the weatherbox from a wikipedia page using the API?

Most of the larger cities have a table with climate data. I think Wikipedia calls them weatherbox.
Is there a way to retrieve these tables via the API?
For instance, to get the climate section for NYC I do:
https://en.wikipedia.org/w/api.php?action=parse&prop=wikitext&pageid=645042&section=18&format=json
I get the text but not the actual table which is referred to as {{New York City weatherbox}}.
There seems to be another way to retrieve some weatherboxes but this isn't working for many cities.
This one works:
https://en.wikipedia.org/wiki/Template:New_York_City_weatherbox
but this one doesn't:
https://en.wikipedia.org/wiki/Template:Turin_weatherbox

SOLR open search on multiple tables

Say I have authors,publishers,books where authors or publishers may have zero books stored in my DB
how do I index (i.e. config data-congig.xml / schema.xml) my tables so my users can freely type a book title, a publisher or author name and find some results?
1.Make author, publisher, book_title fields in schema and define these filed in qf( query fields) in solr query.
2.You can make a single filed having name of author concatenated with publisher and book title for each book. Make documents book wise. Match searched string in that field it will return all possible results.

Restrict Google Places API search by type

I am performing a query using Google Places API to search for local restaurants
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=..lat,..lon&radius=..radius&type=restaurant&key=..key
However, I am receiving a lot of results for locations that are not primarily restaurants, for example:
Popular hotels with restaurants
Food delivery services
Night clubs
Department stores with dining
etc.
Ideally I would like to restrict my query to only a few types or prohibit certain types by query. Otherwise I would need to do this manually or find another service.
Just add the city name as a prefix in the search string. It will only give the search suggestions in which the user is searching.
eg, pass "NewYork" as a prefix in your search string, now type any word, it will only give you results for NewYork city restaurant, cafes, places, etc