Load html: Difference between revisions
imported>StDoodle mNo edit summary |
imported>Bale html only |
||
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
FunctionPage| | FunctionPage| | ||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
Line 19: | Line 18: | ||
function_description=Returns the HTML from the visited page (not just what is displayed when visiting the page, but all markup) by performing a POST request. Note that for addresses inside of KoL, it is only necessary to supply the page name for {{pspan|page}}, and KoLmafia will populate the rest of the url. However, pages outside of KoL require the full url to be supplied for {{pspan|page}}.</p> | function_description=Returns the HTML from the visited page (not just what is displayed when visiting the page, but all markup) by performing a POST request. Note that for addresses inside of KoL, it is only necessary to supply the page name for {{pspan|page}}, and KoLmafia will populate the rest of the url. However, pages outside of KoL require the full url to be supplied for {{pspan|page}}.</p> | ||
<p>The main difference between this function and {{f|visit_url}} is that this function will only contact the server once each time the script is run; from then on, it will simply reload the previous html. Mainly useful for debugging, when you don't want to use extra server hits.| | <p>The main difference between this function and {{f|visit_url}} is that this function will only contact the server once each time the script is run; from then on, it will simply reload the previous html. Mainly useful for debugging, when you don't want to use extra server hits.</p> | ||
<p>Also, this fuction will only work with URLs or files that end with .htm or .html.| | |||
needscode=yes| | needscode=yes| | ||
Line 26: | Line 27: | ||
special=Note that this function returns an empty string if the page does not exist or if the request times out.| | special=Note that this function returns an empty string if the page does not exist or if the request times out.| | ||
}} | }} | ||
[[Category:Miscellaneous Functions]] |
Latest revision as of 22:34, 6 October 2012
Function Syntax
buffer load_html(string page )
- page is the page to visit
Returns the HTML from the visited page (not just what is displayed when visiting the page, but all markup) by performing a POST request. Note that for addresses inside of KoL, it is only necessary to supply the page name for page, and KoLmafia will populate the rest of the url. However, pages outside of KoL require the full url to be supplied for page.
The main difference between this function and visit_url()
is that this function will only contact the server once each time the script is run; from then on, it will simply reload the previous html. Mainly useful for debugging, when you don't want to use extra server hits.
Also, this fuction will only work with URLs or files that end with .htm or .html.
See Also
Special
Note that this function returns an empty string if the page does not exist or if the request times out.