getContentType
String scrapeableFile.getContentType ( )
Description
Retrieve the POST payload type being used to interpret the page. This can be important with scraping some site's implementation of AJAX, where the payload in explicitly set as xml.
Parameters
This method does not receive any parameters.
Return Values
Returns the content type, as a string (e.g., text/html or text/xml).
Change Log
Version | Description |
---|---|
5.0 | Available for all editions. |
Examples
Write Content Type to Log
// Write to log
session.log( "Content Type: " + scrapeableFile.getContentType( "text/xml" ) );
session.log( "Content Type: " + scrapeableFile.getContentType( "text/xml" ) );
See Also
- setContentType() [scrapeableFile] - Sets the POST payload type
scraper on 08/11/2010 at 2:58 pm
- Printer-friendly version
- Login or register to post comments