Finding current page number in google search image api - google-image-search

Is there any way to find out current page number in search complete callback function of google image search api?
I have defined a function for search complete callback and set it using this setSearchCompleteCallback and found that it is called for each page click also, so is there any way to know what is the current page number?

Found a workaround, the div for current page has css class
gsc-cursor-current-page
This is not what exactly what I asked in the question but it helped me!

Related

Hide popup overlay by default if there is no search results in google custom search engine cse

I am trying to find out solution of this from so many days and couldn't find any solution of this please help me with the solution.
I am using popup overlay of Google CSE. I am using only allowing few sites to show the search results.
If search result is available then it shows like this = https://prnt.sc/qAt0KbTVPNb7
If search result is not available then it shows like this type of empty result interface = https://prnt.sc/WnaeQ6_7yyPF
I want this to automatically trigger close button if no search result is exist.
How can I do this? Please help me with this :(

How can I prevent certain element to get displayed in Google search excerpt?

Currently Google displays elements in the result excerpts that belongs to the functional part of the site. Is there a way to exclude these elements to get crawled/displayed in google?
Like eEdit, eDelete, etc in the example above.
To exclude the pages from Google's index, block them using the Robots.txt file or if it is just the content then use the "rel="nofollow" tag.
Hope this helps.
Update on my particular situation here: I just found out that the frontend code has been generated in a way where the title and the description meta was identical.
Google is smart enough to expect that if a copy is already displayed in the title of the search result there's no reason to add in to the excerpt as well, instead looks for content - believed to be valuable - from the actual page.
Lessons learned:
there's no way to hide elements from google but keep it visible for your users
if you'd like to have control over the content displayed in google searches, avoid using the same copy in your title and description

How to get the file excerpts for search using box api?

http://developers.box.com/docs/#search
This api returns only the files/folders related to the search query. How do I show the search excerpts?
Should I integrate solr/lucene for search?
EDIT:
I mean excerpt from the content of the files/documents. The search snippets that you see like in google.
Example:
http://www.bestrank.com/files/uploads/39/image/anatomy-of-a-search-engine-snippet.png
The description in this case.
The Box API currently does not provide this in the search response, but we're looking at adding it sometime in the future.

Search keyword from google to my site

If user search a particular keyword in google and google returns set of results with url. Now if user comes to my website after clicking any result, then how can I know that search keyword.
In bing and yahoo I am able to get this using "q" and "p" respectively. Like "http://www.bing.com/search?q=......" and "http://in.search.yahoo.com/search......?p=......&.....".
But in google I am unable to find any parameters to get search keyword. I am using php.
Please help.
EDIT:
It is not possible to get the search string once you click on a search result.
if I search for stackoverflow.. this is what I get.. link not showing up properly in a comment..
so adding an answer.. you should be able to "?q=" as well for google
https://www.google.com/search?q=stackoverflow&rlz=1C1CHFX_enUS524US524&oq=sta&aqs=chrome.3.69i60l3j69i59j69i57j69i65.2857j0&sourceid=chrome&ie=UTF-8

Selenium Google searching in loop

I have to create a test script in Selenium which found and click correct link in google search engine.
Script should open google website later enter searched phrase (for example: "ipod blog") later should in results on current page search correct item (for this example: "iPadOS: iOS Blog") when it wouldn't be presented on this page should automatically press "Next page button" and go to next page to moment when correct item will be found (in my case that item is on 21st page of results in google). When element will be found script should stored in log number of page where this item was found.
Can anybody help with this or give any useful tips.
I know how to create this script step by step but I haven't any idea how to create loop for searching correct phrase on google pages and later executed next.

Resources