Estoy intentando acceder a un sitio web local diseñado con el framework Symfony. Funciona perfectamente con el navegador web y con CURL, pero cuando uso Mechanize siempre obtengo la respuesta 401 no autorizada para el servidor.Symfony y mecanizar
import mechanize
# Browser
br = mechanize.Browser()
br.set_debug_http(True)
br.set_debug_redirects(True)
br.set_debug_responses(True)
# Does not change anything even if we change thos
br.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')]
# Here is my website
r = br.open('http://localhost:8080/frontend_dev.php/home')
html = r.read()
# Show the html source
print html
¿Tiene alguna idea de por qué se comporta así?
Gracias
¿Symfony está golpeado o no? Lo que sucede es que escribes morir ("golpear"); en la parte superior del archivo frontend_dev.php? – greg0ire
Si muero ("golpear"); Veo el golpe y no hay error 401. – lc2817