Are you using the query string:
view=discussions%23%2F%3Fpage%3D2
?? For instance:
import mechanize as mech
from urllib import urlencode
host = "http://localhost:8080/1.php"
data = {"view": "discussions#/?page=2"}
data = urlencode(data)
print "encoded data sent by python:\n\t", data
resp = mech.urlopen(host + "?" + data)
print resp.read()
It certainly 'works'. Whether the other side knows how to properly decode and parse the query string is another matter. For instance, if you request the following php program at http://localhost:8080/1.php
:
<?php
parse_str(
urldecode($_SERVER['QUERY_STRING']),
$data
);
//You might also call htmlentities() on the query string
//if a browser was going to display the result
echo "php received the following data:\n";
foreach($data as $key => $val)
{
echo "\t $key ----> $val \n";
}
?>
...the python program outputs:
encoded data sent by python:
view=discussions%23%2F%3Fpage%3D2
php received the following data:
view ----> discussions#/?page=2
As for this:
When the page opens...it gets this...
https://www.simplewebsite.com?view=discussions
Completely bypassing what's after the "#" mark...
an RFC says:
The query component is indicated by the first question mark ("?")
character and terminated by a number sign ("#") character or by the
end of the URI.
https://www.rfc-editor.org/rfc/rfc3986#section-3.4