[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

06/10/2009 at 02:18PM PDT, ID: 24481065 | Points: 500
[x]
Attachment Details

Groovy: How do I set/modify the UserAgent?

Asked by thomers1 in Groovy, Apache Web Server

Tags: groovy, screen scraping, useragent

i do some screenscraping using groovy.

how can i set or modify the UserAgent that is sent with the HTTP request? i currently see it in my apache access logs as "Java/1.5.0_16" (which is the JDK version i am using).
1:
2:
3:
import org.cyberneko.html.parsers.SAXParser
def url = "http://www.mytesthost.com/"
def html = new XmlSlurper(new SAXParser()).parse(url)
[+][-]06/10/09 04:17 PM, ID: 24597453

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/11/09 05:19 AM, ID: 24601215

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]06/11/09 08:21 AM, ID: 24603417

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091028-EE-VQP-85 - Hierarchy / EE_QW_4_20070622