Closed karlzheng closed 4 months ago
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
`
As described in the template, we won't be able to answer questions on this issue tracker. Please use Stack Overflow
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/"
`