Small Project: python script to scrape 1 webpage and extract data from txt file using regular expression/pattern matching
₹600-1500 INR
Status
Publicerad över fem år sedan
₹600-1500 INR
Betalning vid leverans
Small Project: python script to scrape 1 webpage and extract data from txt file using regular expression/pattern matching
Please dont get carried away by the length of the text here, I have given an elaborated version of my requirement, so that there is no confusion or mismatch in expectations, this is exactly what I need your help with.
1 Write a python script to scrape data from 1 webpage store that data in CSV file
Detailed manual steps to be automated.
Goto [login to view URL]
Filter for “FO Stocks”
Sort by “Value (in lakhs)” column (descending order)
Pick first 5 names listed in “Symbol” column save them in CSV file
Expected output CSV file as
Date,StockName
2018-07-24,TECHM
2018-07-24,DRREDDY
2. Write a python script to extract data from txt file using regular expression / pattern matching
Input txt (Pattern 1)
---------------[START]
Recommendations for the day:
BUY DRREDDY at 1994.0
SL: 21.0 Tgt: 63.0 Qty: 9
SELL TECHM at 712.6
SL: 9.1 Tgt: 27.3 Qty: 24
----------------------------[END]
Input txt (pattern 2)
---------------[START]
INTRDAY CASH SELL
DALMIABHARAT
CMP-2326-2320
SL 2345
TARGET- 2310-2290-2270-2250
----------------------------[END]
Expected Output CSV file
Date,StockName,OrderType,TransactionType,Quantity,EntryPrice,TriggerPrice,StopLoss,Target
2018-07-24,DRREDDY,BO,BUY,4,1994,1994,21,63
2018-07-24,DALMIABHARAT,BO,SELL,,2320,2320,15,10
formula for Pattern 1
Quantity = (rounddown(Qty/2,0))
Formula for pattern 2
EntryPrice= second value in CMP line
Stoploss=EntryPrice - value in SL line
Target=EntryPrice - First value in TARGET line
System Environment
OS - Ubuntu 16.04.4 LTS
Python 2.7.12