Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Anomaly Detection in Microservices Systems
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sashika sewwandi
Anomaly Detection in Microservices Systems
Commits
38a5cf9e
Commit
38a5cf9e
authored
May 14, 2022
by
sashika sewwandi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
9d254642
Pipeline
#5788
failed with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
webscrape_2.py
webscrape_2.py
+46
-0
No files found.
webscrape_2.py
0 → 100644
View file @
38a5cf9e
from
__future__
import
print_function
import
twint
import
pandas
as
pd
class
Scrapdata
():
def
__init__
(
self
):
self
.
page_link
=
None
self
.
quotes
=
[]
self
.
zip_file_path
=
None
self
.
download_url
=
None
def
create_download_url
(
self
):
try
:
c
=
twint
.
Config
()
c
.
Search
=
[
'Thor'
]
# topic
c
.
Limit
=
10000
# number of Tweets to scrape
c
.
Store_csv
=
True
# store tweets in a csv file
c
.
Output
=
"thor.csv"
# path to csv file
twint
.
run
.
Search
(
c
)
except
Exception
as
e
:
print
(
"Can't scrape data from this site:"
,
self
.
page_link
)
print
(
e
)
@
staticmethod
def
read_data
(
self
):
try
:
df
=
pd
.
read_csv
(
'thor.csv'
)
print
(
df
)
except
Exception
as
e
:
print
(
"file read is unsuccessful"
)
print
(
e
)
def
invoke
(
self
):
self
.
create_download_url
()
self
.
read_data
()
if
__name__
==
'__main__'
:
custom_driver_params
=
'Create a new file WebScraping Twitter data'
new_file
=
Scrapdata
()
new_file
.
invoke
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment