JobFunnel icon indicating copy to clipboard operation
JobFunnel copied to clipboard

Improved search keyword encoding with support for exact phrase

Open akifusenet opened this issue 4 years ago • 5 comments

Issue Template

Description

For example on indeed when you want to search for an exact phrase (multiple words) as keyword you put this phrase between double quotes.

When I want to use this feature on funnel it removes the double quotes and it returns wrong results.

Steps to Reproduce

  1. Use funnel with multiple word as keywords between double quotes
  2. Example: -kw "Data Distribution Service"

Expected behavior

Normally when you write this keywords on indeed website this is the URL that is generated: https://www.indeed.com/jobs?q=%22data+distribution+service%22&l=Saratoga%2C+CA&radius=25

Actual behavior

But funnel generates this url: getting indeed page 0 : http://www.indeed.com/jobs?q=Data Distribution Service&l=Saratoga%2C+CA&radius=25&limit=50&filter=0&start=0

Environment

*Windows 10 Home

akifusenet avatar Jun 12 '20 23:06 akifusenet

Great suggestion for improved usability.

PaulMcInnis avatar Jun 15 '20 15:06 PaulMcInnis

Hi, @akifusenet, I just added a commit that should fix this issue. Could you pull the latest commit and let us know if it fixed the problem?

bunsenmurder avatar Jul 12 '20 17:07 bunsenmurder

Assigning to myself because I need to port this fix to new master

PaulMcInnis avatar Sep 12 '20 01:09 PaulMcInnis

I am thinking it might be wiser if we provide a search config parameter such as --exact-match

PaulMcInnis avatar Sep 13 '20 01:09 PaulMcInnis

I think the simplest way would be to split the search url into two parts: stem_url and arguments. The stem url would contain everything up to arguments, e.g., https://monster.com/jobs/search/ while arguments contains all things like ?q=%22data+distribution+service%22.

The latter can be simplified and clarified by using the urllib.parse.urlencode in which you give the arguments as a dictionary. Strings will also be automatically converted to the URI encoding used for URLS.

markkvdb avatar Oct 02 '20 19:10 markkvdb