Closed denistrofimov closed 10 years ago
Thanks for sharing this code. I've just created the directory web-api-clients
with a couple of examples of clients (python and bash+curl) I already had. If you want, you can place there your node.js code and create a pull request in order to get it merged in the project. Remember to add yourself to the list of contributors inside the AUTHORS
file.
If you want to create and maintain a module in npm registry, it would be nice.
host :www.it.uc3m.es is not working could you please help me to find another way in inegrate html2xtml in python code
Unfortunately, the web server that hosts the service is temporarily down. It won't be up again until next Monday, when my university opens again after Easter holidays. The server has been quite unreliable lately, because it is unattended on weekends and during the university's holyday periods. I don't have better alternatives for hosting it right now.
Besides waiting to Monday, I can suggest two solutions:
I hope this helps.
hello jfisteus, I am new to python coding, I have use your code for input of some wiki development her please find portion of my code. I am using selenium webdriver for web input.
could you please help me how I can integrate binary of html2xhtml in program? your code for the input:
headers = {"Content-type": "text/html",
"Accept": "application/xhtml+xml"}
params = urllib.urlencode({'tablength': 4,
'linelength': 100,
'output-charset': 'UTF-8'})
url = "/jaf/cgi-bin/html2xhtml.cgi?" + params
# read the input HTML file (first command-line argument)
in_file = open('Folder_Intex.htm', 'r')
in_data = in_file.read()
# connect to the server and send the POST request
conn = httplib.HTTPConnection("www.it.uc3m.es:80")
conn.request("POST", url, in_data, headers)
response = conn.getresponse()
wiki_p = response.read()
#conn.close()
driver.find_element_by_link_text("HTML Source").send_keys(Keys.RETURN)
clipboard.copy(wiki_p)
driver.find_element_by_xpath(r'//textarea[@class="qkrPageEditor"]').send_keys(Keys.CONTROL + "v")
driver.find_element_by_link_text("Rich Text").send_keys(Keys.RETURN)
time.sleep(10)
driver.find_element_by_xpath("//input[@value='Save and Close']").send_keys(Keys.RETURN)
time.sleep(10)
Assuming you have html2xhtml compiled and in your PATH:
import subprocess
with open('Folder_index.htm') as in_file):
wiki_p = subprocess.check_output(['html2xhtml'], stdin=in_file)
If it isn't in your PATH, just write its full or relative path in the first argument of the function call:
wiki_p = subprocess.check_output(['path/to/html2xhtml'], stdin=in_file)
If you need to pass command-line arguments, add each one as a string in the list of the first argument:
wiki_p = subprocess.check_output(['path/to/html2xhtml', '-t', '1.1'], stdin=in_file)
hello jfisteus,
millions of thanks for this help now my code is working correctly.... Gaurang
Usage:
May be you want to create separate node.js module in npm registry with this code? Ask me, i can and want to help