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

Request can't get berkshirehathaway letters.html correctly #6761

Closed
karlzheng opened this issue Jul 7, 2024 · 1 comment
Closed

Request can't get berkshirehathaway letters.html correctly #6761

karlzheng opened this issue Jul 7, 2024 · 1 comment
Labels
actions/autoclose-qa Used for automation to auto-close an issue Question/Not a bug

Comments

@karlzheng
Copy link

Hi team,
I use request to get the content of 'https://www.berkshirehathaway.com/letters/letters.html', but it always can't be decoded as text correctly. Could you help to point out the error of following code? Thanks!
`
BRK_letters = "https://www.berkshirehathaway.com/letters/"

headers = {
    'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11'
}            

response = requests.get(f"{self.BRK_letters}letters.html", headers=self.headers)

response.raise_for_status()  # Raise error for bad status codes

`

@karlzheng karlzheng added actions/autoclose-qa Used for automation to auto-close an issue Question/Not a bug labels Jul 7, 2024
Copy link

github-actions bot commented Jul 7, 2024

As described in the template, we won't be able to answer questions on this issue tracker. Please use Stack Overflow

@github-actions github-actions bot closed this as completed Jul 7, 2024
@github-actions github-actions bot locked as off-topic and limited conversation to collaborators Jul 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
actions/autoclose-qa Used for automation to auto-close an issue Question/Not a bug
Projects
None yet
Development

No branches or pull requests

1 participant