Skip to content

StringError("stream did not contain valid UTF-8") #409

Description

@jicee13

I'm very new to rust so forgive me if this is a poor question. However all I am trying to do is get the data from a url and read it into a Document however I keep getting this error

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") }'

I took a look at this issue however my code still isn't too happy. All I'm doing is this..

let url = "http://www.google.com";
let resp = reqwest::get(url).unwrap();
let document = Document::from_read(resp).unwrap();

It works on other websites, but no all (including google). Am I doing something wrong? Could someone point me in the right direction?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions