Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad response from server (JSON vs HTML) - Newer version? #8

Open
HDanyi opened this issue Apr 7, 2023 · 0 comments
Open

Bad response from server (JSON vs HTML) - Newer version? #8

HDanyi opened this issue Apr 7, 2023 · 0 comments

Comments

@HDanyi
Copy link

HDanyi commented Apr 7, 2023

First, thank you very much for this package. I've worked with it before, but after an R update I had to re-install it and now I can't get it to run properly.

First issue was related with self signed certificates and I circumvented it with:

httr::set_config(httr::config(ssl_verifypeer = 0L))

Still, I can't get the basic functions to run. For example,

rstatscn::statscnQueryZb(zbid = "zb", dbcode = "hgnd")
Error: lexical error: invalid char in json text.
<!doctype html>
(right here) ------^
rstatscn::statscnQueryData('A010101',dbcode='hgyd')
Error in dataJson2df(ret, curQuery$rowcode, curQuery$colcode) :
Bad response from the statscn server
The first error indicates that the issue is that the actual webpage the package is scrapping from. It should be a JSON file and it's HTML. Still, I don't now how to ammend this.
In the version I had before, I used to even have language options. Is there a newer version that I am not aware of? Is there a way to fix this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant