Please help me with GET request parameters.
The problem: How to enable image search in Google Custom Search API?
The manual is here, but it woks only for web search.
For example doing a web search with text flowers returns:
{https://www.googleapis.com/customsearch/v1?key={MY-KEY}&cx=013036536707430787589:_pqjad5hr1a&q=flowers&alt=json}
Image search should have the extra parameter searchType=image
{https://www.googleapis.com/customsearch/v1?key={MY-KEY}&cx=013036536707430787589:_pqjad5hr1a&q=flowers&searchType=image&alt=json}
But it returns JSON with 0 search results.
Please tell me what I’m doing wrong.
Thanks in advance.
This should be enabled in the search engine configuration (disabled by default). I also spent some time on why it wouldn't work.
I had the same situation, then I tried to configure the search engine and it worked afterwards
Go to "programmablesearchengine.google.com/controlpanel/all"
FInd your using engine and click
The website will navigate to the control panel
"Overview -> Search function"
Turn on "image search" and "search the entire web
Refer to the image below:
I used the API Explorer to emulate a search and got the corrected URL that way
https://www.googleapis.com/customsearch/v1?q={QUERY}&cx={CX}&{OPTIONS}={VALUES}&key={YOUR_API_KEY}&searchType=image&alt=json
As silly as it sounds, apparently the exact order matters for it to work.
Related
I'm new to stackoverflow (Hello World!). I have some basic understanding of JS, C++, HTML, and CSS and I have been looking in this and other forums but I am having problems figuring out this one, mostly because I don't know what this would be called (TLDR at the bottom):
Essentially, I would like build a chrome extension that extracts data from a website (in this case, copart - a website where people sell cars) and create a link from it that opens another window to one of three car evaluators (edmunds, kbb, nada). I fix cars as a hobby but it's a pain to have to input vehicle info over and over so I wanted to automatize the process as much as possible. Hopefully this will help others as well.
E.g. a generic link to edmunds is: https://www.edmunds.com/ford/escape/2018/appraisal-value/?vin=XXXXXXXXXXXXXX. I would like to know how to extract the make, model, year and VIN, in this case, from copart (Example copart page). On Kbb, e.g., all I see that can automatized is inputting the vin into the window and clicking "Go". Is there a way to have the plugin automatically select "VIN" and copy the VIN into the field while clicking the "Go" button?
Kbb
I know, a lot of questions. I'm also not quite sure what this would be called? A crawler? A scraper? A craper? :)
Either way, here the basic (TLDR) question:
How to create a chrome plugin that extracts data from one website, opens a URL using that data, and which then performs an action like switching a label, populating a textbox, and clicking a button on that URL?
I have only posed this question here so if there's a better place to put it, please let me know.
Mark
Extracting data from one website and searching more for scraped data in other website
1. For this project you can use combination of selenium and scrapy
2. Since both are dynamic page powered by javascript do need to check on security constraints
3. Can make use of spider under scrapy each spider with support of selenium
4. there is need of pressing Go button that can be achieved using selenium
We are working with a custom top level domain per developer which points to it's localhost, so internally we would have url's like this
companywebsite.com.john
companywebsite.com.mike
subdomain1.companywebsite.com.john
..
subdomain99.companywebsite.com.john
The problem is that every time when we need to access a sub-domain for the first time(and we have a lot of them) chrome always redirects to a google search, then after a few attempts, asks if we actually mean
http://subdomain99.companywebsite.com.john/
So, my question is, how could I set up chrome to always parse that kind of url as a url not a search.
Thank's
In the end this is what we ended up doing:
1. go to **Settings**
2. in Search section click on **Manage search engines**
3. Scroll down to the bottom until you find an empty entry
4. Fill in these values: (noSearch, null, http://%s)
5. Scroll back up in the list, find it and click **Make default**
For my case I found an easy solution by chance, add a forawrd slash / at the end of your url and chrome will revert to url, in your example: companywebsite.com.john/
Check the screenshots below:
Before you add slash
when you add the slash at the end, Chrome will translate it to a url
I work at a gym at the front desk. The website we use takes awhile to navigate using the GUI. This console in the Google Chrome browser seems pretty powerful. Can someone please direct me to some sort of tutorial or even answer this question yourself?
How would I use the Google Chrome console (inspect element > console) to perform searches using the website's search ability?
Thanks for your help!
You will need some basic understanding of javascript and DOM to do this.
If your site has a simple form for searching, you could use something like this.
document.getElementById('IdOfSearchField').value = 'test';
document.getElementById('IdOfSearchForm').submit();
What is does is that it fiends the searchfield and sets its value to "test" and then it submits the search form.
On this site (sorry for it being in Swedish, it was the one I was currently working on) you could use the following to search for 'test'.
document.getElementById('query').value = 'test'; document.getElementById('SpeedSearchForm').submit();
If your site has jQuery loaded you could simplify this a bit.
$('#query').val('test'); $('#SpeedSearchForm').submit();
Another way of doing it would be to navigate directly to the searchresult-page with the proper querystring (if that is supported by your website. In my sample case, it would look like this (because the search page is located at /search and just need the querystring query to work).
window.location = '/search?query=test';
But as ajp15243 noted in the comments on the question, it all depends on how your site is built. It's also a bit messy to type all that for every search.
I am a doctor and frequently search for colleagues. I am almost never a potential patient looking to make an appointment. The least useful results to me are those from vitals.com and healthgrades.com. However, occasionally I need them. So the obvious thing to do is append -site:healthgrades.com -site:vitals.com to each google search I do looking for a particular doctor. How do I code that in a url? If I know the URL then I could make a custom search in my browser and call it up with a nice short keyword.
I looked at Google Custom Search but that insists on starting with some particular sites. I want to search the whole internet but exclude just two sites.
I have used Google Custom Search to achieve this. Set up your custom search engine, then go into the "Sites" settings and add the top level domains (*.com, *.org, etc.) to the "Included sites" section. Add whatever sites you wish to skip in the "Excluded sites" section. Good to go!
Here's a screen shot of my setup
Google states that:
Adding "top-level domains" such as '.com', '.travel/*' is not
permitted in Google site search.
(http://support.google.com/customsearch/bin/answer.py?hl=en&answer=71826)
but I have not had any issues doing so - not sure if this may change in the future but it seems to work at present!
I had the same problem, so here is how I changed Chrome's Google search settings (copied original search URL and created new search type in search engines settings):
{google:baseURL}search?q=-site%3Avitals.com%2B-site%3A%2Bhealthgrades.com%20%s&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:iOSSearchLanguage}{google:searchClient}{google:sourceId}{google:instantExtendedEnabledParameter}{google:contextualSearchVersion}ie={inputEncoding}
The other problem I got is duplicate results like for "Primary care physician in 60654" page in search results.
Google search results example for the query
Sometimes google returns multiple pages from one domain, which I don't like, but could influence on this only by additional javascript :)
Is there any microformat/standard for implementing search form on the site?
(access keys, naming etc.)
Any good practices?
The only things I can think of are that searches should be GET requests, and that you may want to implement a RESTful API that allows developers to query JSON and XML results in addition to HTML
If you are trying to implement a plugin for browsers like IE and Firefox to allow for search/autocomplete in the search box of the browser, check out this: https://developer.mozilla.org/en/creating_opensearch_plugins_for_firefox
Here are some conventions I follow. Forgive me if these are not exactly on topic with microformats, or "technically not" in the way I describe the various parts to my answer.
I have found validation in these few standards I've copied from others:
HTML form ID = "search"
Action URL for the form is //root-of-site/search/
Search Results URL construct:
//root-of-site/search?q=queryClause1+Clause2&AnotherParamName=foo
[personally that structure bugs me a little because search-forward-slash appears to be a directory, and the search-question-mark looks like a page taking a query string, and IMO a page should have a suffix. I've been tempted to use search.cgi or search.app, but I see the big guys using /search?q= and so it is]
ID of search query is "q" (this is nearly universal in adoption)