Jump to content

detect browser search bar auto complete


frank10
 Share

Recommended Posts

When I use Chrome or Edge in Amazon, if I type some letters or words in its search bar, the browser suggests some results, like 10 rows.

I want to simulate this behaviour to detect those auto completes and put them in an array.

How can I do this? Preferably with some http code without direct interaction with the browser.

TIA

image.thumb.png.49002857c93c95705c49973066ce8c8b.png

Link to comment
Share on other sites

Open your browser's Developer's Tools and switch to the Network tab. Perform your "search" and then review the activity in the DT window.

You should find where it is performing a WinHTTP Get against a URL, such as --

https://completion.amazon.com/api/2017/suggestions?session-id=147-8024950-1234567&customer-id=A15ABCDEFOAF3F&request-id=Q2CA4S1QB4WSA4RDNCMA&page-type=ABGateway&lop=en_US&site-variant=desktop&client-info=amazon-search-ui&mid=ATVPDKIKX0DER&alias=aps&b2b=1&fresh=0&ks=67&prefix=acc&event=onKeyPress&limit=11&fb=1&suggestion-type=KEYWORD&suggestion-type=WIDGET&_=1580910576378

And this request returns a JSON string containing the suggestions --

{"alias":"aps","prefix":"acc","suffix":null,"suggestions":[{"suggType":"KeywordSuggestion","type":"KEYWORD","value":"accordian file organizer","refTag":"nb_sb_ss_i_1_3","strategyId":"organic-pltr","ghost":false,"help":false,"queryUnderstandingFeatures":[{"source":"QU_TOOL","annotations":[]}],"fallback":false,"blackListed":false,"spellCorrected":false,"xcatOnly":false},{"suggType":"KeywordSuggestion","type":"KEYWORD","value":"accordian file organizer","refTag":"nb_sb_ss_c_2_3","scopes":[{"type":"ALIAS","value":"office-products","display":"Office Products"}],"strategyId":"organic-pltr","ghost":false,"help":false,"queryUnderstandingFeatures":[{"source":"QU_TOOL","annotations":[]}],"fallback":false,"blackListed":false,"spellCorrected":false,"xcatOnly":false},{"suggType":"KeywordSuggestion","type":"KEYWORD","value":"accupressure mats","refTag":"nb_sb_ss_i_3_3","strategyId":"organic-pltr","ghost":false,"help":false,"queryUnderstandingFeatures":[{"source":"QU_TOOL","annotations":[]}],"fallback":false,"blackListed":false,"spellCorrected":false,"xcatOnly":false},{"suggType":"KeywordSuggestion","type":"KEYWORD","value":"accordian file","refTag":"nb_sb_ss_i_4_3","strategyId":"organic-pltr","ghost":false,"help":false,"queryUnderstandingFeatures":[{"source":"QU_TOOL","annotations":[]}],"fallback":false,"blackListed":false,"spellCorrected":false,"xcatOnly":false},{"suggType":"KeywordSuggestion","type":"KEYWORD","value":"accusharp knife sharpener","refTag":"nb_sb_ss_i_5_3","strategyId":"organic-pltr","ghost":false,"help":false,"queryUnderstandingFeatures":[{"source":"QU_TOOL","annotations":[]}],"fallback":false,"blackListed":false,"spellCorrected":false,"xcatOnly":false},{"suggType":"KeywordSuggestion","type":"KEYWORD","value":"accordian folders","refTag":"nb_sb_ss_i_6_3","strategyId":"organic-pltr","ghost":false,"help":false,"queryUnderstandingFeatures":[{"source":"QU_TOOL","annotations":[]}],"fallback":false,"blackListed":false,"spellCorrected":false,"xcatOnly":false},{"suggType":"KeywordSuggestion","type":"KEYWORD","value":"accupuncture pens","refTag":"nb_sb_ss_i_7_3","strategyId":"organic-pltr","ghost":false,"help":false,"queryUnderstandingFeatures":[{"source":"QU_TOOL","annotations":[]}],"fallback":false,"blackListed":false,"spellCorrected":false,"xcatOnly":false},{"suggType":"KeywordSuggestion","type":"KEYWORD","value":"accu-chek aviva plus test strips","refTag":"nb_sb_ss_i_8_3","strategyId":"organic-pltr","ghost":false,"help":false,"queryUnderstandingFeatures":[{"source":"QU_TOOL","annotations":[]}],"fallback":false,"blackListed":false,"spellCorrected":false,"xcatOnly":false},{"suggType":"KeywordSuggestion","type":"KEYWORD","value":"accounting ledger book","refTag":"nb_sb_ss_i_9_3","strategyId":"organic-pltr","ghost":false,"help":false,"queryUnderstandingFeatures":[{"source":"QU_TOOL","annotations":[]}],"fallback":false,"blackListed":false,"spellCorrected":false,"xcatOnly":false},{"suggType":"KeywordSuggestion","type":"KEYWORD","value":"accutane","refTag":"nb_sb_ss_i_10_3","strategyId":"organic-pltr","ghost":false,"help":false,"queryUnderstandingFeatures":[{"source":"QU_TOOL","annotations":[]}],"fallback":false,"blackListed":false,"spellCorrected":false,"xcatOnly":false},{"suggType":"KeywordSuggestion","type":"KEYWORD","value":"accordion file organizer","refTag":"nb_sb_ss_i_11_3","strategyId":"organic-pltr","ghost":false,"help":false,"queryUnderstandingFeatures":[{"source":"QU_TOOL","annotations":[]}],"fallback":false,"blackListed":false,"spellCorrected":false,"xcatOnly":false}],"suggestionTitleId":null,"responseId":"BI6WRJNRXY4M","shuffled":false}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...