honeybansal23 commited on
Commit
fe89926
·
1 Parent(s): 0eacdd5
Files changed (3) hide show
  1. Dockerfile +40 -50
  2. __pycache__/app.cpython-311.pyc +0 -0
  3. app.py +222 -209
Dockerfile CHANGED
@@ -1,61 +1,51 @@
1
- # # Use the official Python image as the base image
2
- # FROM python:3.10-slim
3
-
4
- # # Install dependencies for Selenium and Chrome
5
- # RUN apt-get update && apt-get install -y \
6
- # wget \
7
- # unzip \
8
- # curl \
9
- # gnupg \
10
- # libnss3 \
11
- # libgconf-2-4 \
12
- # libxi6 \
13
- # libxcursor1 \
14
- # libxrandr2 \
15
- # libxss1 \
16
- # libxtst6 \
17
- # fonts-liberation \
18
- # xdg-utils \
19
- # libatk-bridge2.0-0 \
20
- # libgtk-3-0 \
21
- # --no-install-recommends && \
22
- # apt-get clean && \
23
- # rm -rf /var/lib/apt/lists/*
24
 
25
  # RUN apt-get update && apt-get install -y wget unzip && \
26
  # wget https://dl.google.com/Linux/direct/google-chrome-stable_current_amd64.deb && \
27
  # apt install -y ./google-chrome-stable_current_amd64.deb && \
28
  # rm google-chrome-stable_current_amd64.deb && \
29
  # apt-get clean
30
- # RUN useradd -m -u 1000 user
31
- # USER user
32
- # ENV HOME=/home/user \
33
- # PATH=/home/user/.local/bin:$PATH
34
-
35
- # WORKDIR $HOME/app
36
- # # WORKDIR /app
37
-
38
- # COPY --chown=user . $HOME/app
39
- # # COPY . /app
40
- # # Install Python dependencies
41
- # RUN pip install --no-cache-dir -r requirements.txt
42
-
43
- # # Run the Selenium script
44
- # # CMD ["gunicorn", "-b", "0.0.0.0:7860","app:app"]
45
- # CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
46
- ARG PORT=443
47
- FROM cypress/browsers:latest
48
-
49
- RUN apt-get install python3 -y
50
-
51
- RUN echo $(python3 -m site --user-base)
52
 
53
- COPY requirements.txt .
 
 
 
54
 
55
- ENV PATH /home/root/.local/bin:${PATH}
 
 
 
56
 
57
- RUN apt-get update && apt-get install -y python3-pip && pip install -r requirements.txt
 
58
 
59
- COPY . .
 
 
 
60
 
61
- CMD uvicorn main:app --host 0.0.0.0 --port $PORT
 
 
 
1
+ # Use the official Python image as the base image
2
+ FROM python:3.10-slim
3
+
4
+ # Install dependencies for Selenium and Chrome
5
+ RUN apt-get update && apt-get install -y \
6
+ wget \
7
+ unzip \
8
+ curl \
9
+ gnupg \
10
+ libnss3 \
11
+ libgconf-2-4 \
12
+ libxi6 \
13
+ libxcursor1 \
14
+ libxrandr2 \
15
+ libxss1 \
16
+ libxtst6 \
17
+ fonts-liberation \
18
+ xdg-utils \
19
+ libatk-bridge2.0-0 \
20
+ libgtk-3-0 \
21
+ --no-install-recommends && \
22
+ apt-get clean && \
23
+ rm -rf /var/lib/apt/lists/*
24
 
25
  # RUN apt-get update && apt-get install -y wget unzip && \
26
  # wget https://dl.google.com/Linux/direct/google-chrome-stable_current_amd64.deb && \
27
  # apt install -y ./google-chrome-stable_current_amd64.deb && \
28
  # rm google-chrome-stable_current_amd64.deb && \
29
  # apt-get clean
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
+ # Update the package list and install wget, unzip, and Firefox
32
+ RUN apt-get update && apt-get install -y wget unzip \
33
+ && apt-get install -y firefox-esr \
34
+ && apt-get clean
35
 
36
+ RUN useradd -m -u 1000 user
37
+ USER user
38
+ ENV HOME=/home/user \
39
+ PATH=/home/user/.local/bin:$PATH
40
 
41
+ WORKDIR $HOME/app
42
+ # WORKDIR /app
43
 
44
+ COPY --chown=user . $HOME/app
45
+ # COPY . /app
46
+ # Install Python dependencies
47
+ RUN pip install --no-cache-dir -r requirements.txt
48
 
49
+ # Run the Selenium script
50
+ # CMD ["gunicorn", "-b", "0.0.0.0:7860","app:app"]
51
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
__pycache__/app.cpython-311.pyc CHANGED
Binary files a/__pycache__/app.cpython-311.pyc and b/__pycache__/app.cpython-311.pyc differ
 
app.py CHANGED
@@ -1,174 +1,175 @@
1
- # import os
2
- # import random
3
- # import time
4
- # import pandas as pd
5
- # from fastapi import FastAPI, HTTPException
6
- # from selenium import webdriver
7
- # from selenium.webdriver.chrome.service import Service
8
- # from selenium.webdriver.common.action_chains import ActionChains
9
- # from selenium.webdriver.chrome.options import Options
10
- # from webdriver_manager.chrome import ChromeDriverManager
11
- # from webdriver_manager.core.driver_cache import DriverCacheManager
12
- # from selenium.webdriver.common.by import By
13
- # from fake_headers import Headers
14
- # from fastapi.middleware.cors import CORSMiddleware
15
- # import logging
16
- # from selenium_driverless import webdriver as webdriverless
17
-
18
-
19
- # # Initialize FastAPI
20
- # app = FastAPI(
21
- # debug=True,
22
- # title="NextAnalytics Server",
23
- # consumes=["application/x-www-form-urlencoded", "multipart/form-data"],
24
- # docs_url='/swagger'
25
- # )
26
-
27
- # # Configure CORS
28
- # app.add_middleware(
29
- # CORSMiddleware,
30
- # allow_origins=["*"],
31
- # allow_credentials=True,
32
- # allow_methods=["*"],
33
- # allow_headers=["*"],
34
- # )
35
-
36
- # # Setup ChromeDriver and Selenium
37
- # # custom_wdm_cache = os.path.join(os.getcwd(), 'custom_wdm_cache')
38
- # # os.environ['WDM_LOCAL'] = custom_wdm_cache
39
-
40
- # # Setup logging
41
- # logging.basicConfig(level=logging.INFO)
42
-
43
- # def setup_chromedriver():
44
- # logging.info("Setting up ChromeDriver...")
45
- # # custom_wdm_cache = os.path.join(os.getcwd(), 'custom_wdm_cache')
46
- # # os.environ['WDM_LOCAL'] = custom_wdm_cache
47
- # # cache_manager = DriverCacheManager(custom_wdm_cache)
48
- # # os.chmod(custom_wdm_cache, 0o755) # Ensure proper permissions
49
- # # path = ChromeDriverManager(cache_manager=cache_manager).install()
50
- # path = ChromeDriverManager().install()
51
- # os.chmod(path, 0o755) # Ensure ChromeDriver is executable
52
- # logging.info(f"ChromeDriver path: {path}")
53
- # return path
54
-
55
- # # Setup headless Chrome options
56
- # # Define a custom user agent
57
- # my_user_agent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36"
58
-
59
- # # my_user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36"
60
-
61
- # # proxy = None
62
- # browser_option = Options()
63
- # browser_option.add_argument("--headless") # Running in headless mode (no GUI)
64
- # browser_option.add_argument("--no-sandbox")
65
- # browser_option.add_argument("--disable-dev-shm-usage")
66
- # browser_option.add_argument("--ignore-certificate-errors")
67
- # # browser_option.add_argument("--disable-gpu")
68
- # # browser_option.add_argument("--log-level=3")
69
- # # browser_option.add_argument("--disable-notifications")
70
- # # browser_option.add_argument("--disable-popup-blocking")
71
- # browser_option.add_argument(f"--user-agent={my_user_agent}")
72
-
73
- # # if proxy:
74
- # # browser_option.add_argument(f"--proxy-server={proxy}")
75
-
76
-
77
- # # Setup WebDriver
78
- # driver_path = setup_chromedriver()
79
- # service = Service(executable_path=driver_path)
80
- # driver = webdriver.Chrome(service=service, options=browser_option)
81
- # # actions = ActionChains(driver)
82
-
83
- # def getSearchPostData(search_keyword, index, name="", forCompetitorAnalysis=False):
84
- # # Navigate to the search results page
85
- # url = f'https://www.reddit.com/search/?q={search_keyword}'
86
- # driver.get(url)
87
- # time.sleep(3) # Consider using WebDriverWait instead of sleep for better reliability
88
- # logging.info("Navigated to search page.")
89
-
90
- # posts_data = []
91
- # list_length = 0 # posts count
92
- # try:
93
- # if forCompetitorAnalysis:
94
- # driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
95
- # time.sleep(5)
96
- # post_cards = driver.find_elements(By.CSS_SELECTOR, 'a[data-testid="post-title-text"]')
97
- # post_cards_1 = driver.find_elements(By.CSS_SELECTOR, 'div[data-testid="search-counter-row"]')
98
- # post_cards_2 = driver.find_elements(By.CSS_SELECTOR, 'faceplate-timeago')
99
- # logging.info(f"Found {len(post_cards)} post cards.")
100
-
101
- # idx = list_length
102
- # for card in post_cards_1:
103
- # try:
104
- # votes_count = card.find_element(By.XPATH, './/faceplate-number').text
105
- # comments_count = card.find_element(By.XPATH,
106
- # './/span[contains(text(), "comment") or contains(text(), "comments")]/preceding-sibling::faceplate-number'
107
- # ).text
108
- # posts_data.append({
109
- # "index": idx,
110
- # "comment_count": comments_count,
111
- # "votes_count": votes_count
112
- # })
113
- # idx += 1
114
- # except Exception as e:
115
- # logging.error(f"Error processing post_card_1: {e}")
116
-
117
- # idx = list_length
118
- # for card in post_cards:
119
- # try:
120
- # url = card.get_attribute("href")
121
- # title = card.text
122
- # posts_data[idx]["title"] = title
123
- # posts_data[idx]["url"] = url
124
- # idx += 1
125
- # except Exception as e:
126
- # logging.error(f"Error processing post_cards: {e}")
 
127
 
128
- # idx = list_length
129
- # for card in post_cards_2:
130
- # try:
131
- # time_element = card.find_element(By.XPATH, './time')
132
- # post_time = time_element.get_attribute('datetime')
133
- # posts_data[idx]["time"] = post_time
134
- # idx += 1
135
- # except Exception as e:
136
- # logging.error(f"Error processing post_cards_2: {e}")
137
- # except Exception as e:
138
- # logging.error(f"Error in scrolling or extracting data: {e}")
139
-
140
- # df = pd.DataFrame(posts_data)
141
- # df.to_csv(f'posts_data_{index}.csv', index=False)
142
- # logging.info(f"Data saved to posts_data_{index}.csv")
143
- # return df
144
-
145
- # def get_webpage_title(url: str) -> str:
146
- # try:
147
- # getSearchPostData(search_keyword="migraine", index=0)
148
- # url="https://www.reddit.com"
149
- # driver.get(url)
150
- # title = driver.title
151
- # logging.info(f"Page title: {title}")
152
- # return title
153
- # except Exception as e:
154
- # logging.error(f"Error fetching webpage title: {e}")
155
- # return str(e)
156
-
157
- # @app.get("/")
158
- # async def home():
159
- # return {"message": "Hello"}
160
-
161
- # @app.get("/get-title/")
162
- # async def fetch_title(url: str):
163
- # """
164
- # Fetch the title of a webpage by URL.
165
- # Example: /get-title/?url=https://www.reddit.com
166
- # """
167
- # try:
168
- # title = get_webpage_title(url)
169
- # return {"url": url, "title": title}
170
- # except Exception as e:
171
- # raise HTTPException(status_code=500, detail=str(e))
172
  # @app.get("/get-reddit/")
173
  # async def getReddit(url: str):
174
  # """
@@ -199,43 +200,55 @@
199
  # except Exception as e:
200
  # raise HTTPException(status_code=500, detail=str(e))
201
 
202
- # # Run the app
203
- # # if __name__ == "__main__":
204
- # # import uvicorn
205
- # # uvicorn.run(app, host="127.0.0.1", port=7860)
206
-
207
- from selenium import webdriver
208
- from flask import Flask, request
209
- from selenium.webdriver.chrome.service import Service
210
- from webdriver_manager.chrome import ChromeDriverManager
211
- from selenium.webdriver.common.by import By
212
-
213
- app = Flask(__name__)
214
-
215
 
216
- def download_selenium():
217
- chrome_options = webdriver.ChromeOptions()
218
- driver_agent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36"
219
-
220
- chrome_options.add_argument("--headless")
221
- chrome_options.add_argument("--no-sandbox")
222
- chrome_options.add_argument("--disable-dev-shm-usage")
223
- prefs = {"profile.managed_default_content_settings.images": 2}
224
- chrome_options.add_experimental_option("prefs", prefs)
225
- chrome_options.add_argument(f"--user-agent={driver_agent}")
226
- driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
227
- driver.get("https://reddit.com")
228
- title = driver.title
229
- # language = driver.find_element(By.XPATH, "//div[@id='SIvCob']").text
230
- data = {'Page Title': title}
231
- return data
232
-
233
-
234
- @app.route('/', methods = ['GET','POST'])
235
- def home():
236
- if (request.method == 'GET'):
237
- return download_selenium()
238
-
239
-
240
- if __name__ == "__main__":
241
- app.run(debug=True, port=3000)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import random
3
+ import time
4
+ import pandas as pd
5
+ from fastapi import FastAPI, HTTPException
6
+ from selenium import webdriver
7
+ from selenium.webdriver.firefox.service import Service
8
+ from selenium.webdriver.common.action_chains import ActionChains
9
+ from selenium.webdriver.firefox.options import Options
10
+ from webdriver_manager.firefox import GeckoDriverManager
11
+ from webdriver_manager.core.driver_cache import DriverCacheManager
12
+ from selenium.webdriver.common.by import By
13
+ from fake_headers import Headers
14
+ from fastapi.middleware.cors import CORSMiddleware
15
+ import logging
16
+ from selenium_driverless import webdriver as webdriverless
17
+
18
+
19
+ # Initialize FastAPI
20
+ app = FastAPI(
21
+ debug=True,
22
+ title="NextAnalytics Server",
23
+ consumes=["application/x-www-form-urlencoded", "multipart/form-data"],
24
+ docs_url='/swagger'
25
+ )
26
+
27
+ # Configure CORS
28
+ app.add_middleware(
29
+ CORSMiddleware,
30
+ allow_origins=["*"],
31
+ allow_credentials=True,
32
+ allow_methods=["*"],
33
+ allow_headers=["*"],
34
+ )
35
+
36
+ # Setup ChromeDriver and Selenium
37
+ # custom_wdm_cache = os.path.join(os.getcwd(), 'custom_wdm_cache')
38
+ # os.environ['WDM_LOCAL'] = custom_wdm_cache
39
+
40
+ # Setup logging
41
+ logging.basicConfig(level=logging.INFO)
42
+
43
+ def setup_chromedriver():
44
+ logging.info("Setting up ChromeDriver...")
45
+ # custom_wdm_cache = os.path.join(os.getcwd(), 'custom_wdm_cache')
46
+ # os.environ['WDM_LOCAL'] = custom_wdm_cache
47
+ # cache_manager = DriverCacheManager(custom_wdm_cache)
48
+ # os.chmod(custom_wdm_cache, 0o755) # Ensure proper permissions
49
+ # path = ChromeDriverManager(cache_manager=cache_manager).install()
50
+ path = GeckoDriverManager().install()
51
+ os.chmod(path, 0o755) # Ensure ChromeDriver is executable
52
+ logging.info(f"ChromeDriver path: {path}")
53
+ return path
54
+
55
+ # Setup headless Chrome options
56
+ # Define a custom user agent
57
+ my_user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0"
58
+
59
+ # my_user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36"
60
+
61
+ # proxy = None
62
+ browser_option = Options()
63
+ browser_option.add_argument("--headless") # Running in headless mode (no GUI)
64
+ browser_option.add_argument("--no-sandbox")
65
+ browser_option.add_argument("--disable-dev-shm-usage")
66
+ browser_option.add_argument("--ignore-certificate-errors")
67
+ # browser_option.binary_location = r'C:\Users\HP\.cache\selenium\firefox\win64\133.0\firefox.exe'
68
+ # browser_option.add_argument("--disable-gpu")
69
+ # browser_option.add_argument("--log-level=3")
70
+ # browser_option.add_argument("--disable-notifications")
71
+ # browser_option.add_argument("--disable-popup-blocking")
72
+ browser_option.add_argument(f"--user-agent={my_user_agent}")
73
+
74
+ # if proxy:
75
+ # browser_option.add_argument(f"--proxy-server={proxy}")
76
+
77
+
78
+ # Setup WebDriver
79
+ driver_path = setup_chromedriver()
80
+ service = Service(executable_path=driver_path)
81
+ driver = webdriver.Firefox(service=service, options=browser_option)
82
+ # actions = ActionChains(driver)
83
+
84
+ def getSearchPostData(search_keyword, index, name="", forCompetitorAnalysis=False):
85
+ # Navigate to the search results page
86
+ url = f'https://www.reddit.com/search/?q={search_keyword}'
87
+ driver.get(url)
88
+ time.sleep(3) # Consider using WebDriverWait instead of sleep for better reliability
89
+ logging.info("Navigated to search page.")
90
+
91
+ posts_data = []
92
+ list_length = 0 # posts count
93
+ try:
94
+ if forCompetitorAnalysis:
95
+ driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
96
+ time.sleep(5)
97
+ post_cards = driver.find_elements(By.CSS_SELECTOR, 'a[data-testid="post-title-text"]')
98
+ post_cards_1 = driver.find_elements(By.CSS_SELECTOR, 'div[data-testid="search-counter-row"]')
99
+ post_cards_2 = driver.find_elements(By.CSS_SELECTOR, 'faceplate-timeago')
100
+ logging.info(f"Found {len(post_cards)} post cards.")
101
+
102
+ idx = list_length
103
+ for card in post_cards_1:
104
+ try:
105
+ votes_count = card.find_element(By.XPATH, './/faceplate-number').text
106
+ comments_count = card.find_element(By.XPATH,
107
+ './/span[contains(text(), "comment") or contains(text(), "comments")]/preceding-sibling::faceplate-number'
108
+ ).text
109
+ posts_data.append({
110
+ "index": idx,
111
+ "comment_count": comments_count,
112
+ "votes_count": votes_count
113
+ })
114
+ idx += 1
115
+ except Exception as e:
116
+ logging.error(f"Error processing post_card_1: {e}")
117
+
118
+ idx = list_length
119
+ for card in post_cards:
120
+ try:
121
+ url = card.get_attribute("href")
122
+ title = card.text
123
+ posts_data[idx]["title"] = title
124
+ posts_data[idx]["url"] = url
125
+ idx += 1
126
+ except Exception as e:
127
+ logging.error(f"Error processing post_cards: {e}")
128
 
129
+ idx = list_length
130
+ for card in post_cards_2:
131
+ try:
132
+ time_element = card.find_element(By.XPATH, './time')
133
+ post_time = time_element.get_attribute('datetime')
134
+ posts_data[idx]["time"] = post_time
135
+ idx += 1
136
+ except Exception as e:
137
+ logging.error(f"Error processing post_cards_2: {e}")
138
+ except Exception as e:
139
+ logging.error(f"Error in scrolling or extracting data: {e}")
140
+
141
+ df = pd.DataFrame(posts_data)
142
+ df.to_csv(f'posts_data_{index}.csv', index=False)
143
+ logging.info(f"Data saved to posts_data_{index}.csv")
144
+ return df
145
+
146
+ def get_webpage_title(url: str) -> str:
147
+ try:
148
+ getSearchPostData(search_keyword="migraine", index=0)
149
+ url="https://www.reddit.com"
150
+ driver.get(url)
151
+ title = driver.title
152
+ logging.info(f"Page title: {title}")
153
+ return title
154
+ except Exception as e:
155
+ logging.error(f"Error fetching webpage title: {e}")
156
+ return str(e)
157
+
158
+ @app.get("/")
159
+ async def home():
160
+ return {"message": "Hello"}
161
+
162
+ @app.get("/get-title/")
163
+ async def fetch_title(url: str):
164
+ """
165
+ Fetch the title of a webpage by URL.
166
+ Example: /get-title/?url=https://www.reddit.com
167
+ """
168
+ try:
169
+ title = get_webpage_title(url)
170
+ return {"url": url, "title": title}
171
+ except Exception as e:
172
+ raise HTTPException(status_code=500, detail=str(e))
173
  # @app.get("/get-reddit/")
174
  # async def getReddit(url: str):
175
  # """
 
200
  # except Exception as e:
201
  # raise HTTPException(status_code=500, detail=str(e))
202
 
203
+ # Run the app
204
+ # if __name__ == "__main__":
205
+ # import uvicorn
206
+ # uvicorn.run(app, host="127.0.0.1", port=7860)
 
 
 
 
 
 
 
 
 
207
 
208
+ # from selenium import webdriver
209
+ # from flask import Flask, request
210
+ # from selenium.webdriver.chrome.service import Service
211
+ # from webdriver_manager.chrome import ChromeDriverManager
212
+ # from selenium.webdriver.common.by import By
213
+ # from selenium.webdriver.common.proxy import Proxy, ProxyType
214
+ # app = Flask(__name__)
215
+
216
+
217
+ # def download_selenium():
218
+ # prox = Proxy()
219
+ # prox.proxy_type = ProxyType.MANUAL
220
+ # prox.http_proxy = "ip_addr:port"
221
+ # prox.socks_proxy = "ip_addr:port"
222
+ # prox.ssl_proxy = "ip_addr:port"
223
+ # chrome_options = webdriver.ChromeOptions()
224
+ # driver_agent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36"
225
+ # capabilities = webdriver.DesiredCapabilities.CHROME
226
+ # prox.to_capabilities(capabilities)
227
+ # chrome_options.add_argument("--headless=new")
228
+ # # chrome_options.add_argument(f"--proxy-server={proxy}")
229
+ # chrome_options.add_argument("--no-sandbox")
230
+ # chrome_options.add_argument("--disable-dev-shm-usage")
231
+ # # chrome_options.add_argument("--ignore-certificate-errors")
232
+ # # chrome_options.add_argument("--disable-gpu")
233
+ # # chrome_options.add_argument("--log-level=3")
234
+ # # chrome_options.add_argument("--disable-notifications")
235
+ # # chrome_options.add_argument("--disable-popup-blocking")
236
+ # prefs = {"profile.managed_default_content_settings.images": 2}
237
+ # # chrome_options.add_experimental_option("prefs", prefs)
238
+ # chrome_options.add_argument(f"--user-agent={driver_agent}")
239
+ # driver = webdriver.Chrome(service=Service(ChromeDriverManager().install(),desired_capabilities=capabilities), options=chrome_options)
240
+ # driver.get("https://reddit.com")
241
+ # title = driver.title
242
+ # # language = driver.find_element(By.XPATH, "//div[@id='SIvCob']").text
243
+ # data = {'Page Title': title}
244
+ # return data
245
+
246
+
247
+ # @app.route('/', methods = ['GET','POST'])
248
+ # def home():
249
+ # if (request.method == 'GET'):
250
+ # return download_selenium()
251
+
252
+
253
+ # if __name__ == "__main__":
254
+ # app.run(debug=True, port=3000)