Godot has a XMLParser class that you can use to parse HTML, is valid to remember that HTML and XML has some subtle differences, but for most scenarios you should be able to achieve the result you expect, I really don't recommend you to manually split/find/regex the text.
func _ready():
$HTTPRequest.connect("request_completed", self, "_on_request_completed")
$HTTPRequest.request("https://godotengine.org/qa/user/ramazan")
func _on_request_completed(_result, _response_code, _headers, _body):
var parser: XMLParser = XMLParser.new()
parser.open_buffer(_body)
while parser.read() != ERR_FILE_EOF:
if parser.get_node_name() == "form" and parser.has_attribute("method") and parser.has_attribute("action"):
if parser.get_attribute_value(1).find('../user/') == 0:
print(parser.get_attribute_value(1)) # ../user/ramazan
Although you can get the same text just parsing the url.