theekshanamadumal commited on
Commit
8c1f8f7
1 Parent(s): 1bbce87

streamlit image

Browse files
Files changed (3) hide show
  1. .gitignore +128 -0
  2. app.py +2 -2
  3. extract.py +1 -1
.gitignore ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ flagged/
2
+ test/
3
+
4
+ # Editors
5
+ .vscode/
6
+ .idea/
7
+
8
+ # Vagrant
9
+ .vagrant/
10
+
11
+ # Mac/OSX
12
+ .DS_Store
13
+
14
+ # Windows
15
+ Thumbs.db
16
+
17
+ # Source for the following rules: https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore
18
+ # Byte-compiled / optimized / DLL files
19
+ __pycache__/
20
+ *.py[cod]
21
+ *$py.class
22
+
23
+ # C extensions
24
+ *.so
25
+
26
+ # Distribution / packaging
27
+ .Python
28
+ build/
29
+ develop-eggs/
30
+ dist/
31
+ downloads/
32
+ eggs/
33
+ .eggs/
34
+ lib/
35
+ lib64/
36
+ parts/
37
+ sdist/
38
+ var/
39
+ wheels/
40
+ *.egg-info/
41
+ .installed.cfg
42
+ *.egg
43
+ MANIFEST
44
+
45
+ # PyInstaller
46
+ # Usually these files are written by a python script from a template
47
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
48
+ *.manifest
49
+ *.spec
50
+
51
+ # Installer logs
52
+ pip-log.txt
53
+ pip-delete-this-directory.txt
54
+
55
+ # Unit test / coverage reports
56
+ htmlcov/
57
+ .tox/
58
+ .nox/
59
+ .coverage
60
+ .coverage.*
61
+ .cache
62
+ nosetests.xml
63
+ coverage.xml
64
+ *.cover
65
+ .hypothesis/
66
+ .pytest_cache/
67
+
68
+ # Translations
69
+ *.mo
70
+ *.pot
71
+
72
+ # Django stuff:
73
+ *.log
74
+ local_settings.py
75
+ db.sqlite3
76
+
77
+ # Flask stuff:
78
+ instance/
79
+ .webassets-cache
80
+
81
+ # Scrapy stuff:
82
+ .scrapy
83
+
84
+ # Sphinx documentation
85
+ docs/_build/
86
+
87
+ # PyBuilder
88
+ target/
89
+
90
+ # Jupyter Notebook
91
+ .ipynb_checkpoints
92
+
93
+ # IPython
94
+ profile_default/
95
+ ipython_config.py
96
+
97
+ # pyenv
98
+ .python-version
99
+
100
+ # celery beat schedule file
101
+ celerybeat-schedule
102
+
103
+ # SageMath parsed files
104
+ *.sage.py
105
+
106
+ # Environments
107
+ .env
108
+ .venv
109
+ env/
110
+ venv/
111
+ ENV/
112
+ env.bak/
113
+ venv.bak/
114
+
115
+ # Spyder project settings
116
+ .spyderproject
117
+ .spyproject
118
+
119
+ # Rope project settings
120
+ .ropeproject
121
+
122
+ # mkdocs documentation
123
+ /site
124
+
125
+ # mypy
126
+ .mypy_cache/
127
+ .dmypy.json
128
+ dmypy.json
app.py CHANGED
@@ -4,7 +4,7 @@ from PIL import Image
4
  from io import BytesIO
5
 
6
  def main():
7
- st.title("Website Visualizer")
8
 
9
  # Get website URL from user input
10
  url = st.text_input("Enter a URL:", "")
@@ -23,7 +23,7 @@ def visualize(url):
23
  innerHTML = take_screenshot(url)
24
  st.subheader("Website preview:")
25
  if innerHTML:
26
- st.Image(innerHTML)
27
  else:
28
  st.error("Error: empty html")
29
 
 
4
  from io import BytesIO
5
 
6
  def main():
7
+ st.title("Website Content Exctractor")
8
 
9
  # Get website URL from user input
10
  url = st.text_input("Enter a URL:", "")
 
23
  innerHTML = take_screenshot(url)
24
  st.subheader("Website preview:")
25
  if innerHTML:
26
+ st.image(innerHTML)
27
  else:
28
  st.error("Error: empty html")
29
 
extract.py CHANGED
@@ -13,7 +13,7 @@ def take_screenshot(url):
13
  wd = webdriver.Chrome(options=options)
14
  wd.set_window_size(1080, 720) # Adjust the window size here
15
  wd.get(url)
16
- wd.implicitly_wait(10)
17
  screenshot = wd.get_screenshot_as_png()
18
  except WebDriverException as e:
19
  return Image.new('RGB', (1, 1))
 
13
  wd = webdriver.Chrome(options=options)
14
  wd.set_window_size(1080, 720) # Adjust the window size here
15
  wd.get(url)
16
+ wd.implicitly_wait(5)
17
  screenshot = wd.get_screenshot_as_png()
18
  except WebDriverException as e:
19
  return Image.new('RGB', (1, 1))