zlacker

[parent] [thread] 1 comments
1. startu+(OP)[view] [source] 2023-03-02 16:47:56
Considering that OpenAI started instruction following alignment a month ago, with 1k workers, to do engineering tasks, coding might be solved now.
replies(1): >>mckrav+Pl
2. mckrav+Pl[view] [source] 2023-03-02 18:17:40
>>startu+(OP)
I have just decided to give it another try on a very straightforward thing. I have asked it to get me a Rust function that uses a headless browser to get the HTML of a fully loaded webpage.

ChatGPT:

let screenshot = tab.capture_screenshot(ScreenshotFormat::PNG, None, true).await?;

let html = String::from_utf8(screenshot).unwrap();

>[...] Once the page is fully loaded, the function captures a screenshot of the page using tab.capture_screenshot(), converts the screenshot to a string using String::from_utf8(), and then returns the string as the HTML content of the page.

Of course, it admits to the mistake (sort of, it still does not get):

> You are correct, taking a screenshot and converting it to text may not always be the best approach to extract the HTML content from a webpage.

It's hilarious.

[go to top]