algolia / docsearch-scraper

DocSearch - Scraper

Home Page:https://docsearch.algolia.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CONFIG is not a valid JSON

martavis opened this issue · comments

I'm trying to run the docker image copied directly from the docs and I'm getting the CONFIG is not a valid JSON error. This is what I'm running:

docker run -it --env-file=.env -e "CONFIG=$(cat algolia-config.json | jq -r tostring)" algolia/docsearch-scraper

where algolia-config.json is at the root of my project. I tried pulling out the cat algolia-config.json | jq -r tostring part and running it separately, which worked. Also, here is my project folder structure:

image

and my config file:

{
  "index_name": "answers",
  "start_urls": ["https://answers.alpha.equityforhire.com"],
  "stop_urls": [],
  "selectors": {
    "lvl0": "main article header h1",
    "lvl1": "main article h2",
    "lvl2": "main article h3",
    "lvl3": "main article h4",
    "lvl4": "main article h5",
    "lvl5": "main article h6",
    "text": "main article p,main article ul,main article table,main article blockquote,main article dl,main article ol"
  }
}

Is there anything I'm doing wrong? I was able to run this about 2 months ago with the same settings.

Running the command in Windows requires running in Git Bash.