# How to get data from database in html page created in web dev module

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-data-from-database-in-html-page-created-in-web-dev-module/32098>\
**Category:** General Discussion\
**Created:** [February 10, 2020, 3:41pm UTC](https://forum.inductiveautomation.com/t/how-to-get-data-from-database-in-html-page-created-in-web-dev-module/32098 "2020-02-10T15:41:36Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [February 13, 2020, 3:54pm UTC](https://forum.inductiveautomation.com/t/how-to-get-data-from-database-in-html-page-created-in-web-dev-module/32098/22 "2020-02-13T15:54:17Z")

</div>

> [@prafull\_j](#):
>
> Do a google search for “This site can’t be reached” you may get a lot of tips for the likely cause.

Do a google search for “This site can’t be reached” you may get a lot of tips for the likely cause.

Can you also please send me a screen shot of your error with the URL visible

---

<div class="post-metadata">

**Author:** ![Stevenson.Yuan](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Stevenson.Yuan](https://forum.inductiveautomation.com/u/Stevenson.Yuan)\
**Post date:** [February 14, 2020, 6:52pm UTC](https://forum.inductiveautomation.com/t/how-to-get-data-from-database-in-html-page-created-in-web-dev-module/32098/23 "2020-02-14T18:52:35Z")

</div>

Hopefully this is what you’re looking for:  
I created a webdev Python resource:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b8cbe93891b3c210a2678be8c5eab957e8ca4f7c.png)

```auto
	ds = system.dataset.toPyDataSet(system.dataset.toDataSet(["col1","col2","col3"],[['a','b','c'],['d','e','f'],['g','h','i'] ]))
	htmlText= "<html><body>"

	if len(ds)> 0:
		htmlText+= "<table><tr>"
		# set up the table header
		for colHdr in system.dataset.getColumnHeaders(ds):
			htmlText+= "<th>%s</th>"%(colHdr)
		htmlText+= "</tr>"
		
		#parse the dataset into an html structure
		for row in ds:
			htmlText+= "<tr>"
			for col in row:
				htmlText+="<td>%s</td>"%col
			htmlText+="</tr>"
		
		
		# done with the rows
		htmlText+="</table>"
	
	htmlText+="</body></html>"	
	return {'html': htmlText}

```

accessing the url: [http://localhost:8088/system/webdev/projname/webdev\_resource\_name](http://localhost:8088/system/webdev/projname/webdev_resource_name)

results in a webpage:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/305ea4ddef9a37b3496a25e385c1d92856b18135.png)

[Previous page](https://forum.inductiveautomation.com/t/how-to-get-data-from-database-in-html-page-created-in-web-dev-module/32098.md?page=1)
