-3
votes
1answer
26 views

How can I put a user input option in an if statement (Python/HTML)

I am making a form for a website and for one part I have to add the giftwrapping to the final cost if the user selects it. checked = form.getvalue("giftwrap") I tried: elif total > 150 and (b1 ...
0
votes
1answer
25 views

Parsing large XML file to find data linked to another piece of data

I have a 9mb xml file that contains information on the system I am writing the script for. The system saves small files called symbols each symbol has a tick type and belongs to an estate. The data ...
0
votes
1answer
18 views

post text from files into a web page form using python

I have a set of text files. I need to input them one after the other to a web server. I know how to input text using mechanize but have no idea how to extract text from files stored on computer and ...
0
votes
1answer
22 views

Twitter Photo Card Pulling

I'm trying to make a Twitter Photo Card which uses HTML meta Tags. The first problem is, the tag looks something like this <meta property="twitter:image" id="photo" ...
1
vote
0answers
20 views

Unable to retrieve json output from python to php

I am trying to create a webpage that takes in a file and sends the file to a python program, manipulates it and sends the results back to php and then displayed back to the webpage. For now, I am ...
0
votes
2answers
18 views

output html in terminal error

I'm trying to print out html content in following way: from lxml import html import requests url = ...
-4
votes
0answers
14 views

Rendering sql output on web with sqlalchemy engine on flask

I have an application built on Python-Flask framework. What I am trying to do is display a sql table output on a page of my website and i do this by connecting SQLAlchemy to an external populated ...
0
votes
1answer
14 views

Writing full contents of Pandas dataframe to HTML table

I am embedding links in one column of a Pandas dataframe (table, below) and writing the dataframe to hmtl. Links in the dataframe table are formatted as shown (indexing first link in table): In: ...
0
votes
0answers
35 views

form[“x”] throws a KeyError

I'm working on an assignment and we are to create a HTML order form then execute the info by python to create a second customer receipt. Here is the error msg: Traceback (most recent call last): ...
0
votes
1answer
35 views

python BeautifulSoup how get values between tags?

My html structure is: <div class="layout4-background"> <h6 class="game">Game1. How to get all listings below and assign to class"game"?</h6> <ul> <li ...
0
votes
2answers
24 views

Django Form Submission Failing

I'm working on a little app that allows you to save specific location information about places you've been. The issue I'm having is that clicking the submit button on the 'save new location' page ...
-2
votes
3answers
35 views

IF Statement regarding tax (python/html)

My If statements wont give me any correct answers. Can someone have a look at them? if total > 150 and b1 == "BC" or b1 == "bc" or b1 == "Bc" or b1 == "bC": print"<p>Tax: ...
1
vote
2answers
19 views

Prevent a list of names from splitting in a line break in a Django template

I have a list of people's names that I'm passing to my django template, then displaying it as a comma-separated string within an HTML table cell: {{ list_of_names|join:", " }} which works well, but ...
0
votes
0answers
10 views

Python: How can I get all the content from a textbox in a form (cgi script)? form.getvalue(“textBoxName”) only gets me the first word/letter?

So my code looks something like this: form = cgi.FieldStorage( ) question1= form.getvalue( "question1" ) print question1 The problem is, only the first word of question1 textbox is ...
1
vote
1answer
18 views

Python Parsing HTML Table Generated by JavaScript

I'm trying to scrape a table from the NYSE website (http://www1.nyse.com/about/listed/IPO_Index.html) into a pandas dataframe. In order to do so, I have a setup like this: def htmltodf(url): page = ...
0
votes
3answers
16 views

Python 2.7 File Container containing HTML XML JPG PNG PDF with f.readlines()

Okay I got a file container that is a product of a Webcrawler containing a lot of different file types, likely but not all are HTML XML JPG PNG PDF. Most of the container is HTML text so I tried to ...
0
votes
0answers
20 views

HTML Order Form Need to be Executed into a receipt using Python [on hold]

I'm having an absolute headache trying to figure out how to execute the following HTML order form into a customer receipt using python. I kept trying to form the python script but it never worked. ...
1
vote
1answer
29 views

Using pandas to read downloaded html file

As title, I tried using read_html but give me the following error: In [17]:temp = pd.read_html('C:/age0.html',flavor='lxml') File "<string>", line unknown XMLSyntaxError: htmlParseStartTag: ...
1
vote
2answers
30 views

Multiple Values for a single key in a dictionary

I am currently writing a script that extracts data from an xml and writes it into an html file for easy viewing on a webpage. Each piece of data has 2 pieces of "sub data": Owner and Type. In order ...
-3
votes
1answer
31 views

If statement (python/ html) [duplicate]

I am trying to calculate the tax but whenever I try to execute the if statements, it says 'BC' not defined. The if statements regrding tax are near the end.Any help is appreciated. Heres my code: ...
0
votes
1answer
16 views

Python/bs4: Span inside div tag - text extraction

I'm beating with an text extraction from div tag. The point is that there is a tag without opening pair, inside the div tag. So if I do this: raw = soup.find('div', class_='inside').text I get only ...
0
votes
1answer
31 views

Python HTML displaying web link

For some reason this code isn't displaying the link. I get an error message instead. Is there something I'm missing here? #!/usr/local/bin/python3 print("Content-type: text/html\n") print("<a ...
1
vote
1answer
19 views

python lxml printing empty list

This piece of code prints [] each time. I've checked via firepath and manually, and the xpath expression is correct. source = requests.get('http://example.com').text x = source.encode('ascii', ...
-1
votes
1answer
63 views

Python + HTML programming website order form

Hi I am working on a school project where I need to make an order form for a website using python and HTML. I am having trouble adding these: if form.getvalue("interior"): print ...
0
votes
1answer
16 views

python-bottle Attempt to access uploaded file returns Nonetype

So I have a form that is meant to upload an excel file @bottle.route('/nextstep') def nextstep(): return """<html> <head> <title></title> </head> <body> ...
0
votes
2answers
26 views

use a css stylesheet on a jinja2 template

I am making a website using html, css, flask and jinja2. I have a page working on a flask server, the buttons and labels etc. are displayed, but the css stylesheet I have is not loaded in. How would ...
0
votes
1answer
22 views

how to refresh BeautifulSoup's cache?

I use BeautifulSoup to modify html files. But I think the modification which I have made cannot write back to BeautifulSoup's cache immediately. For example: >>> from bs4 import ...
0
votes
3answers
24 views

Regex to grab number in line

I have an html file that I am reading the below line from. I would like to grab only the number that appears after the ':' and before the ',' using REGEX... THANKS IN ADVANCE ...
1
vote
3answers
29 views

How to get data from inspect element of a webpage using Python

I'd like to get the data from inspect element using Python. I'm able to download the source code using BeautifulSoup but now I need the text from inspect element of a webpage. I'd truly appreciate if ...
0
votes
1answer
35 views

Python re regex matching issue

Ok please be gentle - this is my first stackoverflow question and I've struggled with this for a few hours. I'm sure the answer is something obvious, staring me in the face but I give up. I'm trying ...
0
votes
1answer
28 views

Python - how to programmatically generate Index.HTML file to list contents of an uploads folder?

I got a web service that allows user to upload files to the "Uploads" folder. These files are accessible by name using the /uploads/filename.ext path. However, unless I know the precise filename, I ...
0
votes
1answer
20 views

HTML scraping using lxml and requests gives a unicode error

I'm trying to use HTML scraper like the one provided here. It works fine for the example they provided. However, when I try using it with my webpage, I receive this error - Unicode strings with ...
0
votes
2answers
37 views

Python: where is htmllib folder?

Where can I find the htmllib folder. It is not in my site-packages folder. I want to read the code of HTMLParser in htmllib. I found this code online class TrackingParser(htmllib.HTMLParser): ...
0
votes
2answers
31 views

Trouble Using JavaScript to Insert HTML Img Tag

I'm using the following code: var oDiv = document.createElement ("DIV"); oDiv.innerHTML='<img src="{{ url_for(\'static\', filename=\'images/bubble4.png\') }}">' to try and insert an image ...
0
votes
1answer
29 views

Extending one child template into another?

I have a base.html file witch has two blocks from two child templates. blog.html and masthead1.html. How do I extend one child template into another? The base.html file has: {% block mastheadname1 ...
0
votes
2answers
33 views

How can we test the address of the server

I recover the address of the server with that command : socket.gethostbyname(socket.gethostname()) So, in the file1.py I have : def main( server_IP, name, version, install_path): template = ...
-2
votes
2answers
33 views

Programmatically save the HTML from internet explorer

is there a programmatical way (preferably in Python) to save the HTML source code from Internet Explorer webpage in Windows? I tried this with Python's urllib2.urlopen but I got 404 error. But I can ...
1
vote
0answers
29 views

How do I get this radio on and off to work with the python file below

HTML code <form action="/cgi-bin/lights.py" method="POST"> <input type="radio" name="lighton" value="on">On<br> <input type="radio" name="lightoff" value="off">Off <br> ...
0
votes
1answer
32 views

Printing Python code on html file

I have a really noob question here , in php if u wanted to print something inside html you did something like this <body> <div> <? echo 'Hi i am inside of a div'; ?> </div> ...
0
votes
0answers
33 views

Python- Tracking bytes parsed while parsing

I wish to know if there is something that help me keep track of HTML bytes parsed vs string (i.e. between tags text) parsed while parsing. How can I do so?
0
votes
1answer
18 views

Django: Multiple Content-Type: text/html appears on html page

I'm working on a Django project that accesses different tables from my database and outputting that information all on one page. The way I'm doing that is: a = get_hostname(request, hostname) b = ...
0
votes
1answer
16 views

Parse between pre tag Python

I'm trying to parse between PRE tags using Python using this code s = br.open(base_url+str(string)) u = br.geturl() seq = br.open(u) blat = BeautifulSoup(seq) for res in ...
0
votes
1answer
20 views

Django - Is there any way to generate some HTML parts on the fly without using the minidom or lxml libs?

I am trying to generate some HTML parts in a template directly using Django and python without the Django templating Engine, is there any way to do that just with what Django offers ? NB: the main ...
0
votes
0answers
41 views

A html page is not updated as soon as files are submitted

These are python (view.py) and html (upload.html) codes for 'mini-tweeter' where photo and text can be uploaded simply. It works well, but has a problem that when photo and text are submitted, ...
-3
votes
0answers
30 views

Opening cmd on client side using button in html webpage? [on hold]

I am creating a web UI based on HTML, JavaScript and php. My requirement is to open a command prompt in client side by a click of a button and that cmd should run a telnet session on an IP (the ...
0
votes
0answers
10 views

How to use python cgi code to search file and display in browser along with its name

I have a simple html file with text input for file name. It will search the file in the folders and display contents in the browser using cgi script. The file can be pdf or image file. Wish to display ...
0
votes
0answers
50 views

Formatting output into an html file for filtering [PYTHON]

I've just written my first script for my first proper job (rather proud). Basically I parse a large xml file that contains 3 types of data: estates, symbols and types. It then creates 3 .txt files ...
1
vote
1answer
46 views

Django can't find the files in static folder

I must be missing something. So this should be how my folder does look: Obviously with the asked image. To increase portability, I use dynamic path in the code. The code in settings.py ...
-2
votes
1answer
33 views

python HTML print a list

here is part of my script. i have a list called content in this code that contains a bunch of ascii in it. my question is how do you print out all those ascii in the rows and columns. all im getting ...
0
votes
2answers
26 views

Form-View Mapping Issue in Django

This is becoming very frustrating, like all of my Django form endeavors have been thus far... I have a search bar form that is supposed to send the user to a url '/project/search/<query>/' and ...